Authentication and Authorization Quick Start

For many subscription services, it is a requirement that subscribers can sign-in and access their subscription. Either to consume it or to manage it, and often both.

INFO-Subscription provides optional, built-in, components to solve common authentication and authorization needs. The components are built such that they can be used with any identity provider (IdP), but with a specific common authorization means. For advanced authorization scenarios where multiple systems contribute to the authorization flow, the components may be used partially or skipped altogether depending on the requirements.

The following is a quick-start to help get you started if all you require is a simple option to authenticate and authorize subscribers to access one or more specific products.

The default subscriber authentication and authorization component is built around Microsoft Azure ADB2C (henceforth just ADB2C). Its a long winded name, but it is basically just an Identity Provider for consumer/customer accounts, in this case INFO-Subscription subscribers.

ADB2C is an Identiy Provider (IdP) and out of the box provides Authentication using OAuth2 and Open Id Connect (OIDC). As part of the authentication flow INFO-Subscription extends the identity with a set of attributes that may be used to Authorize the user for accessing a given product.

Since ADB2C uses OIDC protocol it is likely that the stack you are using has a component or library that can help you along.

The official ADB2C documentation contains a guide on how to send authenticatation requests.

The guide will refer to variables to replace such as tenant, appId, policy and more. Refer to the table below on how to obtain all of this information, when you don’t have access to the desired information.

ADB2C Reference variables


Obtained when signing up an application. Typically the INFO-Subscription tenant name appended with S4Prod (Example: experimentationS4prod)


Defaults to B2C_1_SignIn


Obtained when signing up an application


Obtained when signing up an application


Configured when signing up an application, this is your application URL provided when you signed up the application.

There are quite a few parameters in the table for the auhtorize endpoint, most of which is something you need to consider if hand building the request. If you are using a component or library a lot of this is probably taken care of out of the box.

Example Authorization Code Flow

The following are exsamples of an authorization code flow, to get you started, but we recommend learning about Open Id Connect and specifically ADB2C to get the most out of your authentication and authorization process.


If you have a test account on the Experimentation tenant, the following should be reproducable using just your browser.

Obtaining the authorization code and id token

Connection: keep-alive
Accept: */*

Once the login prompt has been taken care of, a redirect should occur to something like

Sample Redirect/Response
Connection: keep-alive
Accept: */*

At this point you can either use the code to obtain an access_token or you can verify and decode the id_token

Verifying and Decoding the token

The ID Token provided is a JWT token, encoded and signed by the IdP. The signature can be verified by using the key provided in the OIDC Metadata endpoint. Verification is outside the scope of this documentation, we recommend you entrust that to someone who knows cryptography (i.e. a library/component).

Once decoded the id_token contains the identification of the user as well as his/her SubscriberId and any Products that are accessible currently.

The two claims containing the identification:

  • extension_SubscriberId - A SubscriberId representing a specific subscriber.

  • extension_Products - A JSON string containing an array of products and the users current validity of those products.

Sample Id Token
Sample Id Token Decoded
    "exp": 1669977098,
    "nbf": 1669973498,
    "ver": "1.0",
    "iss": "",
    "sub": "62a786d2-5cd2-4a26-9cb0-18b056b9562f",
    "aud": "1b162230-180c-4648-9d0f-a313bb86510c",
    "iat": 1669973498,
    "auth_time": 1669973498,
    "name": "",
    "emails": [
    "extension_SubscriberId": "73265483-0a64-4acc-9ccf-11359ef5ce9f",
    "extension_Products": "[{\"Id\":\"70e75bc0-6c3d-4934-a2e8-08d80b92b721\",\"ValidFrom\":\"2022-06-29T05:37:25.8669071+00:00\",\"ValidTo\":\"2023-06-29T05:37:24.8669071+00:00\"}]",
    "tfp": "B2C_1_Signin",
    "c_hash": "flpwPutr0z_iuOTww7zJdA"

The above JWT is a sample, not all fields will always be available or have values.

extension_SubscriberId may be empty for family members and other shared users.

extension_Products can be empty whenever no mapping exists that grants product access.


ADB2C has some perculiar behaviour when the user has forgotten the password. Refer to the forgotten password section for the details on how to handle it.

Authorization Alternatives

Now that a token has been retrieved and decoded, the next step is to do the actual authorization.

Depending on your need there are two simple alternatives that may be used, either:

  1. Verify that there is something in the extensions_Products list.

  2. Verify that the product requested is available in the extensions_Products list.


extensions_SubscriberId is not part of the suggested auhtorization process, as in most general cases it is not needed.


The two authorization/verification alternatives are suggestions, verify with the business requirements that they will suffice for your case.