Overview
This page describes a fast example of security integration in a 3rd-party service.
The example is based on the current state of the regression environment.
Nutrition OAuth 2.0 Provider is authorization provider for Nutrition Mulesoft APIs. It is dedicated for Machine To Machine (M2M) integrations.
Required precondition:
- Mulesoft applications created in Reckitt Anypoint Exchange with client_id and client_secret :
- one for non-prod environment
- second for production
To achieve this precondition, either way is the proper way 'on request' / 'self service':
On request:
If you don't have access to Reckitt Exchange, please submit your request here: → TODO proces
Self service:
If you already have access to Reckitt Exchange please follow these steps:
Proper authentication:
The steps are:
- Create Authorization Token
- Consume API with the Token
Create Authorization Token
To do that need to send a proper request according to below specification:
Method: POST
Endpoints:
- Stage: https://api.cdp-rb.com/stage/v1/oauth/token
- Production: https://api.cdp-rb.com/v1/oauth/token
Payload (type: application/json):
- client_id - String, mandatory
- client_secret - String, mandatory
- grant_type - String, mandatory, enums: [CLIENT_CREDENTIALS]
example request:
{ "client_id": "459c3f28a4154781bc3bu7ec464ape9c", "client_secret": "1FbDA0fF59cA4dD9B5183E28de594Bc1", "grant_type": "CLIENT_CREDENTIALS" }
example response payloads:
{ "access_token": "dfstzdakvbiRzhSZdw7HKwe0QkbiTFQoaJiP0yx3HWAxbq3mX_zpsW-EOj0_CZHImnkgIFhIF8kOm5HjYqs96Q", "token_type": "Bearer", "expires_in": 1800 }
{ "message": "Bad request: /grant_type LOREM IPSUM is not a valid enum value" }
{ "error": "Invalid client id or secret" }
{ "error": "Quota has been exceeded" }
Create Authorization Token Rate Limiting
This endpoint to create Authorization Tokens has an SLA Based Rate Limiting as follows:
- the rate limiting is applied equally for all Clients
- maxium 5 HTTP calls within 30 seconds for a Client
Authorization Token Time To Live (TTL)
- the maximum TTL for a token is 1800 seconds ( 30 minutes )
- no token refreshing is available
Authorization Token Caching
Caching the Token is highly advised especially considering the 2 factors of:
- the Rate Limiting
- TTL
{"access_token":"cacd5cda-08f8-47fa-8431-82d7a82184a6","token_type":"bearer","refresh_token":"92c437ba-e6ac-4ae2-84ce-ec7338b506b6","expires_in":60}
Add Comment