#NEWLINE# def auth_callback( self , user ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# ( access_token , dropbox_user_id , url_state ) = self . oauth_flow . finish ( request . values ) #NEWLINE# #UNINDENT# except ( DropboxOAuth2Flow . NotApprovedException , DropboxOAuth2Flow . BadStateException ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# except ( DropboxOAuth2Flow . ProviderException , DropboxOAuth2Flow . CsrfException ) : #NEWLINE# #INDENT# raise HTTPError ( http . FORBIDDEN ) #NEWLINE# #UNINDENT# except DropboxOAuth2Flow . BadRequestException : #NEWLINE# #INDENT# raise HTTPError ( http . BAD_REQUEST ) #NEWLINE# #UNINDENT# self . client = DropboxClient ( access_token ) #NEWLINE# info = self . client . account_info ( ) #NEWLINE# return self . _set_external_account ( user , { #NEWLINE# #INDENT# 'key' : access_token , #NEWLINE# 'provider_id' : info [ 'uid' ] , #NEWLINE# 'display_name' : info [ 'display_name' ] , #NEWLINE# #UNINDENT# } )