以下是
provider_config
可以配置。
provider_config={
"issuer": "appid-oauth.ng.bluemix.net",
"authorization_endpoint": appIDInfo['oauthServerUrl']+"/authorization",
"token_endpoint": appIDInfo['oauthServerUrl']+"/token",
"userinfo_endpoint": appIDInfo['profilesUrl']+"/api/v1/attributes",
"jwks_uri": appIDInfo['oauthServerUrl']+"/publickeys"
}
appIDInfo
可以从IBM Cloud上的Cloud Foundry环境中获得,也可以使用如下结构手动配置:
"AppID": {
"clientId": "your App ID client Id",
"managementUrl": "https://appid-management.ng.bluemix.net/management/v4/-----tenantID----",
"oauthServerUrl": "https://appid-oauth.ng.bluemix.net/oauth/v3/-----tenantID----",
"profilesUrl": "https://appid-profiles.ng.bluemix.net",
"secret": "the App ID secret",
"tenantId": "-----tenantID----",
"version": 3
}
这个
clientId
和
secret
然后将用于填充
client_info
烧瓶化脓液所需的对象。我有
sample code using Flask-pyoidc with App ID in a GitHub repository
。它显示了从配置到使用装饰器保护Flask中的应用程序路由的所有步骤。