Service Provider / Authorization Provide API

In this step we show how the service provider verifies access tokens with the authorization provider, and obtains user and client identities.

Setup

Execute the following line to load the libraries:


In [ ]:
require('/opt/notebooks/tutorial/lib/tutorial-utils')(this);

Verifying a client access token

When the client makes a request to the service provider it includes an access token in the Authorization header. The service provider verifies the token with the authorization provider, which returns the user and client identities.

In the following example, replace <service_provider_token> below with the access token for the domain sp:8002. You can see this value by signing in to the authorization provider and visiting http://localhost:8001/admin/domains, or in the service provider config here.

Replace <access_token> with the access token issued to the client in the previous step.


In [ ]:
this.post("http://ap:8001/authorized", {
  access_token: "<access_token>",
  domain: "sp:8002"
}, { token: "<service_provider_token>" });

In [ ]: