...
Create a service provider.
- Access the WSO2 Identity Server Management Console.
- On the Main menu, click Identity > Service Providers > Add.
- Enter
playground2
as the Service Provider Name and click Register. - Copy the content in your client application's certificate in PEM format into the Application Certificate text field.
Insert excerpt Passing OIDC Authentication Request Parameters in a Request Object Passing OIDC Authentication Request Parameters in a Request Object - Expand Inbound Authentication Configuration > OAuth/OpenID Connect Configuration and click Configure.
- Enter
http://localhost:8080/playground2/oauth2client
as the Callback URL. - Click Add.
Note that the OAuthclient key
andclient secret
get generated.
To obtain an access token by invoking the OAuth token endpoint of WSO2 Identity Server, execute the following cRUL in a command prompt.
This request contains the client ID, client's public certificate and any other additional claims and is signed using the client's private key.
Code Block title Format curl -k -d "grant_type=password&username=<USERNAME>&password=<PASSWORD>&client_id=<CLIENT_KEY>" -H "Content-Type: application/x-www-form-urlencoded" https://localhost:9443/oauth2/token -i --cert <CLIENT_PUBLIC_CERTIFICATE> --key <CLIENT_PRIVATE_KEY>
Code Block title Sample token request using mutual TLS client authentication curl -k -d "grant_type=password&username=admin&password=admin&client_id=qiB6avlILBqnJLSxOfadoJYwOnQa" -H "Content-Type: application/x-www-form-urlencoded" https://localhost:9443/oauth2/token -i --cert certificate.pem --key key.pem
Note that an access token gets generated. You can use this access token to access the APIs or any other secured resources of the client application.
Sample response: