SCIM 2.0 API authentication

The SCIM 2.0 protocol support multiple HTTP-based authentication schemes to enable API access by some SCIM client. However, only one method is supported by the Buypass SCIM implementations.

OAuth2 Bearer Token

For all https://buypassdev.atlassian.net/wiki/spaces/DEVSPACE/pages/672595971 , Buypass only support the SCIM authentication scheme of “oauthbearertoken” (OAuth2 Bearer Token). And needless to say, only HTTPS based communication is allowed.

This will also be reflected by the “/ServiceProviderConfig” endpoint:

{ "schemas":["urn:ietf:params:scim:schemas:core:2.0:ServiceProviderConfig"], "documentationUri": "https://developer.buypass.com/", "authenticationSchemes": [ { "name": "OAuth2 Bearer Token", "description": "Authentication scheme using the OAuth2 Bearer Token Standard", "specUri": "https://tools.ietf.org/html/rfc6750", "documentationUri": "https://developer.buypass.com/", "type": "oauthbearertoken", "primary": true }, ...

Using the OAuth2 Bearer Token scheme enable the authentications to be delegated to a OAuth2/OIDC server outside of the SCIM API implementation. This also make the authentication mechanism compatible with https://buypassdev.atlassian.net/wiki/spaces/DEVSPACE/pages/672825345, both client only authentication (https://buypassdev.atlassian.net/wiki/spaces/DEVSPACE/pages/672530574) and end-user authentication OIDC Flows. Note that all best security practises related to bearer tokens (like TLS transport, limited scoping, short lifetimes) are enforced.

As described in RFC 7644, section-2.1, enable SCIM client system to act on:

In the following example, a client sends a POST request containing a"User" to the "/Users" endpoint using a Bearer token for authentication (retrieving the token from the OAuth2/OIDC server is excluded).

POST /<SECURITY DOMAIN>/scim/v2/ HTTP/1.1 Host: api.buypass.no Accept: application/scim+json Content-Type: application/scim+json Authorization: Bearer h480djs93hd8 Content-Length: ... { "schemas":["urn:ietf:params:scim:schemas:core:2.0:User"], "userName":"bjensen", "externalId":"bjensen", "name":{ "formatted":"Ms. Barbara J Jensen", "familyName":"Jensen", "givenName":"Barbara" } }

Retrieving a token

The OAuth2 and OIDC processes for authenticating and retrieveing tokens ar well described here: . However, make note of needed authorization and scoping described below.

Authorization and Scoping

In accordance with the SCIM specification (RFC 7644, section-2.1), are used to give the bearer token (and hence the SCIM client) a representation of an authorization. These scopes are Buypass and SCIM API specific and the authorizations they imply are enforced by the SCIM api implementation. The SCIM client must request an with the appropriate scope. The issuance of such a token is governed by the OIDC/OAuth2 server.

Note that the granularity of authorization needed may differ with the various and their applications.

Standard SCIM API scope to control read, write and delete functionality in the API:

Functionality

Scope

Functionality

Scope

Read data

scim.read

Write/edit/delete data

scim.write