PPaste!

just a test

Home - All the pastes - Authored by Thooms

Raw version

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
def generate_appsecret_proof(access_token, app_secret):
    '''
        @inputs:
            access_token: page access token
            app_secret_token: app secret key
        @outputs:
            appsecret_proof: HMAC-SHA256 hash of page access token
                using app_secret as the key
    '''
    hmac_object = hmac.new(str(app_secret), unicode(access_token), hashlib.sha256)
    generated_hash = hmac_object.hexdigest()
    return generated_hash