You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have defined an oauth2 policy for an API:
{
"api_id": "2a47bd39-59dd-4a5c-918a-e3fd8ab99c40",
"id": "42f54ebf-d772-4617-ad18-2e9bdfbe1010",
"created_at": 1458555035000,
"enabled": true,
"name": "oauth2",
"config": {
"mandatory_scope": true,
"token_expiration": 7200,
"enable_implicit_grant": true,
"scopes": [
"basic",
"extended",
"full"
],
"hide_credentials": false,
"enable_password_grant": false,
"accept_http_if_already_terminated": false,
"provision_key": "2c731c2439da46a5961ba7c0ed6b4ae1",
"enable_client_credentials": false,
"enable_authorization_code": true
}
},
The default expiration_time applies.
Later when we grant a user, using implicit grant, the access_token never expires. When we verify this (on the http://konggateway:8001/oauth2_tokens) we see:
When we look in the source code:
(in access.lua, oauth2 plugin)
-- TODO: Expire token (using TTL ?)
local function generate_token(conf, credential, authenticated_userid, scope, state, expiration, disable_refresh)
local token_expiration = expiration or conf.token_expiration
Should it work? I notice that 'expires_in = token_expiration', and in our case it's 0 even if we added 7200 as default to the Oauth2 policy on the API.
thank you in advance
The text was updated successfully, but these errors were encountered:
Some additional info, in the RFC for OAuth2 - implicit grant:
expires_in
RECOMMENDED. The lifetime in seconds of the access token. For
example, the value "3600" denotes that the access token will
expire in one hour from the time the response was generated.
If omitted, the authorization server SHOULD provide the
expiration time via other means or document the default value.
Can we assume the expiration time is always 0 for this profile?
We have defined an oauth2 policy for an API:
{
"api_id": "2a47bd39-59dd-4a5c-918a-e3fd8ab99c40",
"id": "42f54ebf-d772-4617-ad18-2e9bdfbe1010",
"created_at": 1458555035000,
"enabled": true,
"name": "oauth2",
"config": {
"mandatory_scope": true,
"token_expiration": 7200,
"enable_implicit_grant": true,
"scopes": [
"basic",
"extended",
"full"
],
"hide_credentials": false,
"enable_password_grant": false,
"accept_http_if_already_terminated": false,
"provision_key": "2c731c2439da46a5961ba7c0ed6b4ae1",
"enable_client_credentials": false,
"enable_authorization_code": true
}
},
The default expiration_time applies.
Later when we grant a user, using implicit grant, the access_token never expires. When we verify this (on the http://konggateway:8001/oauth2_tokens) we see:
When we look in the source code:
(in access.lua, oauth2 plugin)
-- TODO: Expire token (using TTL ?)
local function generate_token(conf, credential, authenticated_userid, scope, state, expiration, disable_refresh)
local token_expiration = expiration or conf.token_expiration
local token, err = dao.oauth2_tokens:insert({
credential_id = credential.id,
authenticated_userid = authenticated_userid,
expires_in = token_expiration,
scope = scope
})
Should it work? I notice that 'expires_in = token_expiration', and in our case it's 0 even if we added 7200 as default to the Oauth2 policy on the API.
thank you in advance
The text was updated successfully, but these errors were encountered: