#NEWLINE# @ app . route ( '/api/auth/callback/yahoo/' ) #NEWLINE# def yahoo_authorized( ) : #NEWLINE# #INDENT# response = yahoo . authorized_response ( ) #NEWLINE# if ( response is None ) : #NEWLINE# #INDENT# flask . flash ( 'You denied the request to sign in.' ) #NEWLINE# return flask . redirect ( util . get_next_url ( ) ) #NEWLINE# #UNINDENT# flask . session [ 'oauth_token' ] = ( response [ 'oauth_token' ] , response [ 'oauth_token_secret' ] ) #NEWLINE# fields = 'guid, emails, familyName, givenName, nickname' #NEWLINE# me = yahoo . get ( '/v1/yql' , data = { #NEWLINE# #INDENT# 'format' : 'json' , #NEWLINE# 'q' : ( 'select %s from social.profile where guid = me;' % fields ) , #NEWLINE# 'realm' : 'yahooapis.com' , #NEWLINE# #UNINDENT# } ) #NEWLINE# user_db = retrieve_user_from_yahoo ( me . data [ 'query' ] [ 'results' ] [ 'profile' ] ) #NEWLINE# return auth . signin_user_db ( user_db )