def create_authorization_code(self, request):
     """Generates an authorization grant represented as a dictionary."""
     grant = {'code': common.generate_token()}
     if hasattr(request, 'state') and request.state:
         grant['state'] = request.state
     log.debug('Created authorization code grant %r for request %r.', grant,
               request)
     return grant
 def create_authorization_code(self, request):
     """Generates an authorization grant represented as a dictionary."""
     grant = {'code': common.generate_token()}
     if hasattr(request, 'state') and request.state:
         grant['state'] = request.state
     log.debug('Created authorization code grant %r for request %r.',
               grant, request)
     return grant
示例#3
0
def random_token_generator(request, refresh_token=False):
    return common.generate_token()