def token(self, **kwargs):
if cherrypy.request.method == "OPTIONS":
cherrypy_cors.preflight(
allowed_methods=["POST"], origins='*',
allowed_headers=['Authorization', 'content-type'])
else:
logger.debug('AccessTokenRequest')
try:
authn = cherrypy.request.headers['Authorization']
except KeyError:
authn = None
logger.debug('Authorization: {}'.format(authn))
try:
resp = self.op.token_endpoint(kwargs, authn, 'dict')
except Exception as err:
raise cherrypy.HTTPError(message=str(err))
else:
return conv_response(resp)
评论列表
文章目录