IBM Security Verify

 View Only
  • 1.  IAG - All claims sent to resource server are strings

    Posted Fri March 04, 2022 05:59 AM
    Edited by S Kjemp Fri March 04, 2022 07:32 AM

    Hello, I am currently testing IAG with OAuth introspection. My issue seems to be that the JWT that is sent to the resource server, has some claims with numeric values (e.g., exp, nbf, iat) sent as string. 

    The logged result body from calling introspection endpoint in iag (exp and iat are numbers):

    {
    "active": true,
    "client_id": "client12345id",
    "exp": 1646384697,
    "iat": 1646381097,
    "scope": "scopesrequested",
    "token_type": "bearer",
    "username": "alice"
    }


    When I call https://my.iag.app.io/credview the result is (exp and iat are now strings):

    {
    "AUTHENTICATION_LEVEL": "1",
    "AZN_CRED_AUTHNMECH_INFO": "OAuth Introspect Authentication",
    "AZN_CRED_AUTHZN_ID": "alice",
    "AZN_CRED_AUTH_EPOCH_TIME": "1646388553",
    "AZN_CRED_AUTH_METHOD": "oauth-introspect",
    "AZN_CRED_BROWSER_INFO": "PostmanRuntime/7.28.4",
    "AZN_CRED_IP_FAMILY": "AZN_CRED_IP_FAMILY_AF_INET",
    "AZN_CRED_MECH_ID": "oauth-introspect",
    "AZN_CRED_NETWORK_ADDRESS_STR": "127.0.0.1",
    "AZN_CRED_PRINCIPAL_NAME": "alice",
    "AZN_CRED_QOP_INFO": "SSK: TLSV12: 27",
    "AZN_CRED_REGISTRY_ID": "alice",
    "AZN_CRED_USER_INFO": "alice",
    "active": "true",
    "client_id": "client12345id",
    "exp": "1646384697",
    "iat": "1646381097",
    "scope": [
    "scope1",
    "scope2",
    "scope3",
    "scope4"
    ],
    "tagvalue_login_user_name": "alice",
    "tagvalue_session_index": "sessionindex",
    "tagvalue_user_session_id": "sessionid",
    "token_type": "bearer",
    "username": "alice"
    }


    From my understanding, IAG will use the credview information to create the JWT when making a request towards a resource server. Since you can specify the type (e.g., type: int) of claims in resource_servers.identity_headers.jwt.claims, it should then convert the string to a numeric value:

    EDIT: It does seem that the type field is valid when attr is specified. So that will have no effect.

    version: "%(version)s"
    resource_servers:
    - path: "%(path)s"
    transparent_path: true
    connection_type: "tcp"
    servers:
    - host: "%(host)s"
    port: "%(port)s"
    identity_headers:
    jwt:
    certificate: "...cert..."
    hdr_name: jwt
    claims:
    - name: iss
    text: 'https://www.issuer.io'
    - name: sub
    attr: AZN_CRED_PRINCIPAL_NAME
    - attr: AZN_*
    - name: dest
    text: "Default"
    - name: source
    text: "ext"
    - name: groups
    text: "[ job ]"
    - name: amr
    text: "blabla"
    - name: acr
    attr: AZN_CRED_AUTH_METHOD
    - name: name
    text: "Fake Login : 123"
    - name: aud
    text: "urn:liberty"
    - name: source
    text: "ext"
    - name: exp
    type: int
    attr: exp
    - name: iat
    type: int
    attr: iat
    - name: nbf
    type: int
    attr: iat
    - name: jti
    text: "sdasdklasjdkla"

    However, when the request are received at the resource server. The claims which are specified as int is still strings with double quotes ". What can be the issue here?
    EDIT: From what I learn about the type parameter, it seems it will have no effect on attr. So the question then I guess, is there something wrong with the credview?


    ------------------------------
    S Kjemp
    ------------------------------


  • 2.  RE: IAG - All claims sent to resource server are strings

    Posted Sun March 06, 2022 03:43 PM

    The 'type' field is only used if the value is 'textual' and does not come from a credential attribute.  Here is an extract from the documentation for the 'type' field:

     

    'The type of textual data which is being provided. This will control the JSON type which is used in the JWT. Please note that this field is only valid if a text value has been specified and will be ignored if an attr value is specified.'

     

    Due to the fact that the 'exp' and 'iat' attribute fields in the credential are stored as strings means that they will be inserted into the JWT as strings as well.  Ideally these fields would not be stored in the credential as strings, but at the moment all attributes from the identity token are stored as strings in the credential. 

     

    I hope that this helps.

     

     

    Scott A. Exton
    Senior Software Engineer
    Chief Programmer - IBM Security Verify Access

    IBM Master Inventor

     

     






  • 3.  RE: IAG - All claims sent to resource server are strings

    Posted Sun March 06, 2022 03:59 PM
    Thanks for the reply,

    Okay, so there is no current way to configure/work around this in IAG? Would be nice to avoid having to write custom logic, as we rely on standard JWT decoder libs.

    ------------------------------
    S Kjemp
    ------------------------------



  • 4.  RE: IAG - All claims sent to resource server are strings

    Posted Sun March 06, 2022 05:10 PM

    Unfortunately, there are no work-arounds for this that I can think of.  If this is important, please raise a request-for-enhancements against IAG and the capability can be considered.

     

    Thanks.

     

     

    Scott A. Exton
    Senior Software Engineer
    Chief Programmer - IBM Security Verify Access

    IBM Master Inventor