[OpenID] Beginner's Question: Per-Function-Access-Rights

0 views
Skip to first unread message

[Quipsy] Markus Karg

unread,
May 16, 2022, 10:44:37 AM5/16/22
to openid-...@lists.openid.net

I am new to OpenID and OAuth2 and read several tutorials and references but there is one problem left open I hope you can help with.

 

Our existing application does RBAC with the addition of a complex system of functionality-grained access rights. This means, an authentication token must contain not only roles a user has, but also additional functionalities he is allowed to do. Example: A user that is in the role „Editor“ might have (or might not have) the additional right to execute a special function X. As our application is huge, besides lots of roles there are literally hundred of optional functionalities he could be granted or not. To our knowledge, this is not covered by any of the existing authentication services / products.

 

We did not find a solution for this in „pure“ OpenID Connect / OAuth2, so currently we discuss the following attempts:

 

  1. Let OpenID Connect do ONLY Authentication but not Authorization. This means, our client sends the obtained ID Token to our existing custom authorization service in exchange for a custom authorization token containing the roles AND the per-function-grants.

 

  1. Let OpenID Connect do BOTH Authentication and Authorization, but wrap each single function-based-grant as a role. In the end, this means a token needs to contain literally hundred of roles in turn, which makes it unmanageable in literally all OpenID Connect services / products we evaluaged so far.

 

  1. Maybe there is a standardized flow that allows an authorization service dynamically lookup the function-based-grant from our custom authorization service?

 

Maybe there are other solutions to that problem, but we could not image them.

 

Any comments welcome (besides: do not use per-function-access-rights as this is axiomatic for our product)! 😊

 

-Markus

 

 

Joseph Heenan

unread,
May 18, 2022, 4:26:02 AM5/18/22
to ka...@quipsy.de, gen...@lists.openid.net
Hi Markus

The question you ask is perhaps deceptively simple. I think probably most commercial iDPs should have a solution that fits your needs, but they won’t necessarily all have the same solution, depending on the exact performance / security / user experience needs. It’s probably a little hard to give much in the way of concrete advice without a lot more info about your goals.

The general starting position is normally that the OpenID Connect id_token contains the details of the authentication event, and the OAuth2 access token (generally issued as part of the same flow) represents the authorisation(s). (For various reasons this distinction isn’t always that clear.) The ID Token is generally expected to be consumed by the client, whereas the access token is expected to be consumed by the resource server(s) / API endpoints.

The simple solution is likely that your authorization server directly issues an access token that is the ‘custom authorization token containing the roles AND the per-function-grants’ (this could be a JWT/similar access token that directly contains all the details, or an opaque token that can be introspected to see what the user has access to - the latter is perhaps along the lines you describe in ‘C’, most API gateways should support token introspection as defined in https://datatracker.ietf.org/doc/html/rfc7662 ).

There’s generally a lot to consider when picking your solution here, particularly as you’re likely to be stuck with whatever solution you implement for a long time - it’d probably be worthwhile to engage with the pre-sales process at a particular vendor, who should be able to give you guidance on the best way to address your use cases with their solution, or to engage with a vendor neutral consultant that could help you select the best vendor - there’s a few on the OpenID Foundation members list, https://openid.net/foundation/sponsoring-members/ 

Cheers

Joseph

 
_______________________________________________
general mailing list
gen...@lists.openid.net
https://lists.openid.net/mailman/listinfo/openid-general

[Quipsy] Markus Karg

unread,
May 18, 2022, 7:24:21 AM5/18/22
to Joseph Heenan, gen...@lists.openid.net

Joseph,

 

thanks a lot for your kind answer. We really appreciate all ideas!

 

Actually we need to say that we are an ISV, so we are NOT in the position of selecting an IDP vendor. What we actually strive for is understanding the general OpenID / OAuth2 pattern, how we can integrate into ANY existing company infra structure for SSO. Our customers all over the world already have chosen their IDPs to implement SSO, so there is NO SINGLE IDP and no choice BY US. They expect from us that our highly complex per-function-grants still work well with their particular IDP OR that the IDP only does SSO but not authorization. In particular, they do NOT enforce to manage access rights within their IDP; i. e. it is OK for them to just create ID Token with their particular IDP, forward the ID Token to us, and let us do authorization on our own in a custom way (if no better solution possible).

 

Moreover, as we are dedicated open source committers, we strive for a free solution. So paying someone for answers on the OpenID / OAuth2 standards is out of scope for us. We do not have custom questions or product specific question, we only ask about the standards themselves. So we like to abstain from project-specific consulting / vendor-specific solutions.

 

Hence our questions more clearly actually are:

  • Is there something in OpenID / OAuth2 that fulfils per-function-grants, or do these standards only define RBAC?
  • Does OpenID / OAuth2 allow the separation of the authorization endpoint vendor from the token endpoint vendor? If yes, we would implement our own token endpoint producing our custom authorization tokens in exchange for a standardized ID Token obtained from the IDP.
  • Do OpenID / OAuth2 off-the-shelf products / services allow to create custom tokens? The question is not just if there is SOME product able to do that, but if that is a standardized functionality of OpenID / OAuth2.

Thanks!

-Markus

Cal Heldenbrand

unread,
May 18, 2022, 9:24:34 AM5/18/22
to [Quipsy] Markus Karg, gen...@lists.openid.net
I'll jump in here and suggest that User Managed Access (UMA) might be an acceptable fit for you.  The use case for UMA is more tailored to shifting the power of authorization to users, but the toolset offered in the spec might be something usable for your case.  So, it's not exactly what you need.  But to my knowledge, it's the only open specification that extends OAuth2 and OIDC with a goal of implementing access control. 




Joseph Heenan

unread,
May 18, 2022, 11:24:10 AM5/18/22
to [Quipsy] Markus Karg, gen...@lists.openid.net
Hi Markus

Okay, I think I understand your position better now.

So, yes, if you have to work with a range of existing IDPs then you’re quite limited, not entirely by the protocols but perhaps more by the capabilities of those iDPs and their implementations not having this kind of use case in mind.

To answer your questions:

• Is there something in OpenID / OAuth2 that fulfils per-function-grants, or do these standards only define RBAC?

Scopes (and other things you could use have the idp, directly or indirectly, embed into an access token) technically aren’t quite limited to RBAC but you definitely can’t expect to express a large number of fine grained permissions in any of those ways and have wide interoperability with someone else’s iDP, and even if you could the UIs on the IDP for managing them may not work out well.

• Does OpenID / OAuth2 allow the separation of the authorization endpoint vendor from the token endpoint vendor? If yes, we would implement our own token endpoint producing our custom authorization tokens in exchange for a standardized ID Token obtained from the IDP.

There’s no standard way for your own token endpoint to validate an authorization code issued by an iDP that’s not your own. (It would involve the token endpoint pretending, to your customer’s idp, to be your client, and at that point it’s probably better to call it something other than “token endpoint” to avoid confusion.)

The general way you’d probably do this kind of model (which may or may not be applicable in your case) would be to have your own idp, which then federates out to the iDPs that belong to your customers. The customer’s idp deals with the authentication, and your idp deals with the authorization - essentially (to oversimplify) exchanging the id_token from the customer’s idp for an access token with the correct authorization (and maybe an id_token issued by your own idp as well).

There is the token exchange RFC, https://datatracker.ietf.org/doc/html/rfc8693, but I think the way you’d use this is to have your client talking to your own token endpoint it’s maybe not as big a win to have a standards based interface for that part.

• Do OpenID / OAuth2 off-the-shelf products / services allow to create custom tokens? The question is not just if there is SOME product able to do that, but if that is a standardized functionality of OpenID / OAuth2.

I don’t think there’s really any standards-defined way to do exactly what you ask (other than the above model, where you have your own idp in addition to the customer’s one - and the UMA one that Cal mentioned, but I’m not sure if you’d be able to apply UMA in your situation as I think it would need your customer’s iDPs to support UMA).

Thanks

Joseph

[Quipsy] Markus Karg

unread,
May 19, 2022, 2:31:20 AM5/19/22
to Joseph Heenan, gen...@lists.openid.net

Joseph,

 

thanks a lot.

 

Your comments all are very helpful!

Reply all
Reply to author
Forward
0 new messages