24.2.1 Running the Sample Web Application

Perform the following steps to run the sample web application.

  1. Run the script python oauth2_test.py.

  2. Open the URL http://localhost:8088.

    A message is displayed with the following modes:

    Authorization Code Grant
    Implicit Grant (the token will be received in hash part of THIS page)
    Resource Owner Password Credentials Grant (is not supported by default but it can be activated in AAF)
  3. Select the grant based on your requirement:

    • Authorization Code Grant

      1. Ensure that Use for Owner Password Credentials is set to OFF in the Advanced settings section for the OAuth 2.0 event.

      2. Click the first link.

        The NetIQ Access page is displayed with the user name request.

      3. Specify the Username.

      4. Click Next.

      5. Authenticate using all required methods of the chain.

        The result page shows the access_token, token_type and expires_in.

        • Click Get attributes to look at the attributes.

        • Click Refresh token to refresh token. The access_token value is updated.

    • Implicit Grant

      1. Ensure that Use for Owner Password Credentials is set to OFF in the Advanced settings section for the OAUTH 2.0 event.

      2. Click the first link.

        The NetIQ Access page is displayed with the user name request.

      3. Specify the Username.

      4. Click Next.

      5. Authenticate using all the required methods of the chain.

        The result page shows the access_token, token_type and expires_in.

    • Resource Owner Password Credentials Grant

      1. Open Advanced settings for the OAUTH 2.0 event.

      2. Set Use for Owner Password Credentials to ON.

        NOTE:The Authorization code grant and Implicit grant fail when the Use for Owner Password Credentials is set to ON.

      3. Click the third link.

        A request for Username and Password is displayed.

      4. Specify the username and password, then click Submit.

        The result page displays the access_token, token_type, and expires_in.