OpenLiberty / open-liberty

Open Liberty is a highly composable, fast to start, dynamic application server runtime environment
https://openliberty.io
Eclipse Public License 2.0
1.14k stars 587 forks source link

APSZOS-272 - Add and support AMR claim in JWT #8997

Open atosak opened 4 years ago

atosak commented 4 years ago

Resolves RFE [266680](RFE: https://wasrtc.hursley.ibm.com:9443/jazz/web/projects/External%20Request%20For%20Enhancements#action=com.ibm.team.workitem.viewWorkItem&id=266680)

chunlongliang-ibm commented 4 years ago

amrValues: This is a new configuration property to jwtConsumer and it accepts a string value which can include multiple values separated by comma.

The behavior is as follows:

amrInclude: This is a new configuration property to jwtBuilder and it accepts a string value which can include multiple values separated by comma.

The behavior is as follows:

NOTE: The property names mentioned in the comments has been changed for clarity. authenticationMethodsReferences is changed to amrValues and includeAttributesToAmr is changed to amrInclude

chunlongliang-ibm commented 4 years ago
  1. First add the configuration property
  2. runtime enforce rules defined in configuration.
  3. There is not default behavior change if property is not configured
chunlongliang-ibm commented 4 years ago

my previous comments discussed about JWT consuming. Reading email from stack holder, there is another part of requirements that Liberty (as token issuer) need assert "amr" in JWT. Given that core Liberty security does not have "arm" concept, and does not track information can be used to construct "amr", we could offer option to build "amr" as required by the stack holder. This stack holder does its own credential mapping, so it should have a way to add "arm" related information in subject. The proposal is to add a configuration property to JwtBuilder, which tells Liberty to fetch security attributes from subject as "amr". The assumption is stack holder is responsible to include "amr" data in subject. The design is like this: new property: includeAttributesToAmr (you may want to give a better name). For example, if includeAttributesToAmr ="attribute1 attribute2" The jwtBuilder must search subject's security attributes for attribute1, and attribute2, and include their values as "amr" claim.

brutif commented 4 years ago

Hi @chunlongliang-ibm,

@AlvinChacko fyi.

AlvinChacko commented 4 years ago

Hi @chunlongliang-ibm,

Do you have an update on the above?

chunlongliang-ibm commented 4 years ago

For builder, there is no way doing it by configuration only, as core Liberty security subject does not have knowledge about 'amr' For consumer, you can do it in jwtBuilder, as mpJwt and jwtSso all reference to jwtBuilder

NottyCode commented 4 years ago

@teddyjtorres We need to get the description updated with the proposed design before I can consider whether or not a design socialization is required. The comment from @chunlongliang-ibm is confusing to me as a design since it talks about arrays in two different ways. I would like to see this clarified in the description prior to any delivery.

AlvinChacko commented 3 years ago

This feature introduces a new jwtBuilder and jwtConsumer configuration property to include the AMR claims in the jwt token. In the jwtBuilder, ‘amrInclude’ can be used to specify the subject properties to include in the amr part of the token. In the jwtConsumer, ‘amrValues’ can be used to specify the values included in the incoming jwt token which is then verified accordingly.

AlvinChacko commented 3 years ago

@NottyCode @teddyjtorres has asked me to write a description. Let me know if it makes sense

NottyCode commented 3 years ago

@AlvinChacko I'd like to get comment 0 updated. In terms of the description I don't know what an amrInclude or amrValues is and what they do which makes it difficult to assess whether you are doing what is required. Also you need to provide the types for the new attributes. Part of the no design approval request is to work out if it is eligible for the fast track process or requires a full design. So I need to be confident that this is simple enough not to require SVT or docs work.

AlvinChacko commented 3 years ago

@NottyCode Have you taken a look at comment. I updated a while back

samwatibm commented 3 years ago

RFE moved to https://cloud-platform.ideas.aha.io/ideas/TWAS-I-214

garypicher commented 3 years ago

This work is partially complete, but the team that was working on it was temporarily moved elsewhere, so I am removing the "In Progress" label until someone is able to pick this up again.