def auth_callback_provider( self ):
params = { 'openid.ns': '',
'openid.op_endpoint': '',
'openid.claimed_id': '',
'openid.identity': '',
'openid.return_to': '',
'openid.response_nonce': '',
'openid.assoc_handle': '',
'openid.signed': '',
'openid.sig': '',
}
for key in params:
params[ key ] = self.request.get( key )
params[ 'openid.mode' ] = 'check_authentication'
# param {'openid.claimed_id': u'http://steamcommunity.com/openid/id/7****************'}
claimedId = str( params[ 'openid.claimed_id' ])[ len( 'http://steamcommunity.com/openid/id/' ): ]
loginInfo = { 'provider_name': self.get_provider_name( ),
'provider_uid': claimedId,
'email': '',
'email_verified': '' }
urlParams = enki.libutil.urlencode( params )
fullURL = 'https://steamcommunity.com/openid/login'
result = self.urlfetch_safe( url = fullURL, payload = urlParams, method = urlfetch.POST )
if 'ns:http://specs.openid.net/auth/2.0\nis_valid:true\n' in result.content: # only if is_valid do we trust the loginInfo
self.provider_authenticated_callback( loginInfo )
#===== TWITTER =========================================================================================================
评论列表
文章目录