Authentication

Overview

GoDocs Api Resources are protected behind Azure AD B2C Identity Platform. Users and applications can authenticate as long as they are registered in Azure AD B2C.

For App to App communications our Api resources will require an access token that is issued by Azure Ad B2C. For this workflow we require consuming application to request a token through OAuth2 Client Credential Flow.

Requesting an Access Token via Client Credential Flow:

Request URL

Create a Http Post Call to: (Non-Production)

https://godocstestb2c.b2clogin.com/godocstestb2c.onmicrosoft.com/<policy-name>/oauth2/v2.0/token

Create a Http Post Call to: (Production)

https://godocsprodb2c.b2clogin.com/godocsprodb2c.onmicrosoft.com/<policy-name>/oauth2/v2.0/token

Note: policy-name will be provided by GoDocs

Content Type

 application/x-www-form-urlencoded

Headers

grant_type: "client_credentials",
client_id: "<provided by GoDocs>",
client_secret: "<provided by GoDocs>",
scope: "<provided by GoDocs>",

If the call is successful, you should receive a json response like the following

{
    "access_token": "<access-token>",
    "token_type": "Bearer",
"not_before": 1744998026,
    "expires_in": 3600,
    "expires_on": 1745001626,
    "resource": "187feb14-736d-4955-8202-12341234",
}

   

Accessing GoDocs Api Resource:

When you are able to retrieve a valid Access Token you will need to create an HTTP request. Inside the headers of the request please set the key value pair of:

Content Type

application/json

Headers

Authorization: "Bearer <access_token_value>",
content_type: "application/json"