Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Create a service provider. 

    1. Access the WSO2 Identity Server Management Console. 
    2. On the Main menu, click Identity > Service Providers > Add.
    3. Enter playground2 as the Service Provider Name and click Register.
    4. 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
    5. Expand Inbound Authentication Configuration > OAuth/OpenID Connect Configuration and click Configure.
    6. Enter  http://localhost:8080/playground2/oauth2client  as the Callback URL.
    7. Click Add.
      Note that the OAuth client key and client secret get generated. 
  2. 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
    titleFormat
    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
    titleSample 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: