-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OIDC - Add support for logout and token revocation [THREESCALE-312] #435
Conversation
## create /oidc/logout endpoint - delete access token from cache - add acccess token to the "revoked token cache" - send POST request to the end_session_endpoint of idp ## add token introspection feature - add token introspection feature, only execute when first time to recive tokens - add "APICAST_TOKEN_INTROSPECTION_ENABLED" config
Generated by 🚫 Danger |
@tmogi001 Well done! It is well structured, has tests, 👍 . Sorry it took me so long to take a look at it. I'm not sure about the design of this feature. We made OIDC to remove endpoints from the gateway and allow it to be stateless. If this needs some stronger consistency than just TTL, then it should be stateless in my opinion. I'd like to open the discussion about this and hear what requirements drove it doing it this way. |
@mikz Thank you for looking my PR. And I will fix to execute Token Introspection at every request to the gateway, if "APICAST_TOKEN_INTROSPECTION_ENABLED" is true. I think this option will allow users to choose between "performance" or "security". |
@tmogi001 Let me iterate a bit. Another point I forgot is that now the gateway has access to the IDP as authorized Service Account. I think we need a definition of what are we trying to solve before actually committing to the implementation. Are you sure 1:1 mapping for API calls to the IDP is viable way forward? And when introducing cache it basically behaves the same as forcing to rotate the token every N seconds. |
@mikz I'm sorry I didn't show our problem clearly. We must meet the requirements of financial API. (http://openid.net/specs/openid-financial-api-part-1.html) In FAPI specifications, 6.2.1 Protected resources provisions shows that resource server with the FAPI endpoints "shall verify that the access token is not expired nor revoked". We use gateway as a resource server, so we must meet this requirement. But gateway can't verify the token is revoked without Token Introspection. And in my opinion, API calls to IdP rarely fail. In such as a high-security system, the value of gateway is "Security". |
@tmogi001 that is very useful resource, thank you. I think gateway is just Relaying Party, not the Resource Server. But it is possible I'm not understanding the spec and what Relaying Party is. But ok, I agree it could be useful for the gateway to verify the token is revoked. The gateway has to handle network errors to the IDP. What happens when the gateway can't connect to the IDP ? Should it use last known state? I'm worried this will start exploding in complexity once under production load and network conditions. Also I really don't want to give the gateway the same Service Account as is used in for managing clients via Zync. This access has What are the ways to verify Access Token with least permissions? I guess the token itself can't be used to authorize the call, right? Also I'll need to do some benchmark of the token introspection API to get some numbers on its performance. On another topic. |
Thank you for understanding!
In the system where OpenID connect is required, IDP is critical. When the gateway cannot connect to the IDP, gateway must stop API calls to keep security. To avoid that, HA of IDP and network are required.
I understand your concern. I think we have two choices.
Personally, I think 1 is better.
Thank you for information, I will check it later. |
@lucamaf status is the same as you can see in this issue. "We" are not doing anything. |
Sorry to leave this request for a long time. |
@tmogi001 perfect! Feel free to reach out if you need any help with custom policies. We have a WIP PR that migrates our policies we run in the Cloud Hosted deployment on SaaS: 3scale/apicast-cloud-hosted#1 Also with #495 it should be possible to hook into JWT before the authorization (in the rewrite phase) is sent to 3scale backend (access phase). |
Closing in favour of really great #619 👍 |
Hi,
I create OpenID Connect logout and token revocation feature.THREESCALE-312
specs are below
add /oidc/logout endpoint
When the client send a POST request to the logout endpoint with
header : bearer with access token
body : refresh_token=<refresh token>
then delete access token from the cache and logout from IdP.
add token introspection feature
This feature covers the requests 1) token is not cached, 2) token is not expire and 3) token was revoked at IdP.