#NEWLINE# def token_handler( self , f ) : #NEWLINE# #INDENT# "Access/refresh token handler decorator.\n\n        The decorated function should return an dictionary or None as\n        the extra credentials for creating the token response.\n\n        You can control the access method with standard flask route mechanism.\n        If you only allow the `POST` method::\n\n            @app.route('/oauth/token', methods=['POST'])\n            @oauth.token_handler\n            def access_token():\n                return None\n        " #NEWLINE# @ wraps ( f ) #NEWLINE# def decorated( * args , **kwargs ) : #NEWLINE# #INDENT# server = self . server #NEWLINE# ( uri , http_method , body , headers ) = extract_params ( True ) #NEWLINE# credentials = ( f ( * args , ** kwargs ) or { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# log . debug ( 'Fetched extra credentials, %r.' , credentials ) #NEWLINE# ret = server . create_token_response ( uri , http_method , body , headers , credentials ) #NEWLINE# return create_response ( * ret ) #NEWLINE# #UNINDENT# return self