Azure Active Directory B2C authorization code flow access token response expires_in field as a Int

asked 2022-06-05T23:31:28.113+00:00
Ishara Pannila 21 Reputation points

https://learn.microsoft.com/en-us/azure/active-directory-b2c/authorization-code-flow#2-get-an-access-token

In the above docs the example response for expires_in field shows as below

 {  
   "expires_in":"3600",  
 }  

In the https://datatracker.ietf.org/doc/html/rfc6749#section-5.1 it show as below

 {  
   "expires_in":3600,  
 }  

So my question is,

  1. Is this the default behavior of the expires_in field for B2C authorization code flow ( string instead for int)?
  2. If yes how can we change it to a int?
Azure Active Directory External Identities
No comments
{count} votes

Accepted answer
  1. answered 2022-06-06T08:18:36.73+00:00
    AmanpreetSingh-MSFT 55,171 Reputation points

    Hi @Ishara Pannila • Thank you for reaching out.

    1. Is this the default behavior of the expires_in field for B2C authorization code flow ( string instead for int)?
    Yes, this is the default behavior in case of Azure AD B2C. Regardless of which authentication flow or user flow is used, the "expires_in" parameter is returned as "3600" (string). Whereas in standard Azure AD, this value is returned as an Int.

    2. If yes how can we change it to an int?
    As of now, the type for "expires_in" property is not exposed for customization. Currently, only the value can be increased or decreased but there is no option available to change the type from string to Int. All the customization settings available for JWT Issuer technical profile as documented here: https://learn.microsoft.com/en-us/azure/active-directory-b2c/jwt-issuer-technical-profile#metadata

    I would suggest you post an idea on the User Voice portal to return it as Int rather than a string. This portal is monitored by the product teams for product improvements and feature enhancements.

    -----------------------------------------------------------------------------------------------------------

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    No comments

0 additional answers

Sort by: Most helpful