This documentation is for WSO2 Identity Server 5.6.0 . View documentation for the latest release.

All docs This doc

Versions Compared


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


  1. Open the <IS_HOME>/repository/conf/identity/identity.xml file and uncomment the following entry under <OAuth> element.

    Code Block
  2. Restart the server.
  3. Configure an OAuth service provider.
  4. Initiate an access token request to the WSO2 Identity Server, over a known grant type. For example, the following cURL command illustrates the syntax of an access token request that can be initiated over the Resource Owner Password Credential grant type.

    cURL command
    Code Block
    curl -u <CLIENT_ID>:<CLIENT_SECRET> -k -d "grant_type=password&username=<USERNAME>&password=<PASSWORD>" -H "Content-Type:application/x-www-form-urlencoded" https://<IS_HOST>:<IS_HTTPS_PORT>/oauth2/token
    • Navigate to your service provider, expand Inbound Authenitcaion Configurations and expand OAuth/OpenID Connect Configuration.
      • Copy the OAuth Client Key as the value for <CLIENT_ID>.
      • Copy the OAuth Client Secret as the value for <CLIENT_SECRET>.
    • Enter the username and password of the user you want to get the token as the value for <USERNAME> and <PASSWORD> respectively.
    • By default, <IS_HOST> is localhost. However, if you are using a public IP, the respective IP address or domain needs to be specified.
    • By default, <IS_HTTPS_PORT> has been set to 9443. However, if the port offset has been incremented by n, the default port value needs to be incremented by n.


    Code Block
    curl -u liXJsel4bJ76arbg3DXC3rU4w60a:wQEYq83njU29ZFbpQWdZsUlXcnga -k -d "grant_type=password&username=testuser2&password=testuser2 -H "Content-Type:application/x-www-form-urlencoded" https://localhost:9443/oauth2/token

    In response, the self-contained JWT access token will be returned as shown below.

    Code Block

    The access token you receive is a signed JSON Web Token (JWT). Use a JWT decoder to decode the access token and you are able to see the payload of the token that includes the following JWT claims:

    Claim NameTypeClaim Value
    issstringThe issuer of the JWT. The 'Identity Provider Entity Id ' value of the OAuth2/OpenID Connect Inbound Authentication configuration of the Resident Identity Provider is returned here.
    audstring arrayThe token audience list. The client identifier of the OAuth clients that the JWT is intended for, is sent herewith.
    azpstringThe autorized party for which the token is issued to. The client identifier of the OAuth client that the token is issued for, is sent herewith.
    iatintegerThe token issue time. 
    expintegerThe token expiration time.
    jtistringUnique identifier for the JWT token.

    In addition, a user claims can be obtained by an authorized user over this JWT as per OpenID Connect claim configurations, by configuring requested user claims in the OAuth service provider. After configuring the service provider you can run the cURL command given below by providing the required details.

    Code Block
    curl -u <CLIENT_ID>:<CLIENT_SECRET> -k -d "grant_type=password&username=<USERNAME>&password=<PASSWORD>&scope=openid" -H "Content-Type:application/x-www-form-urlencoded" https://<IS_HOST>:<IS_HTTPS_PORT>/oauth2/token