Skip to content

Latest commit

 

History

History
97 lines (61 loc) · 2.46 KB

03-Container-Test.md

File metadata and controls

97 lines (61 loc) · 2.46 KB

How To Locally Test Containerized NGINX Plus OIDC for Amazon Cognito Integration

Take the following steps to run NGINX Plus in a Docker container and test OIDC for Amazon Cognito integration.

Note: You could remotely test in your remote machine if you copy entire files there.

1. Prerequisites

2. Run a Docker Container

  • Start a Docker container:

    $ make start
  • Check Docker container's status:

    $ make watch

3. Run a Browser and Test OIDC

  • Run a Web Browser with https://nginx.cognito.test, and enter an IdP application's client ID:

  • Login to click Sign in button:

    Enter your name and password which are registered in Amazon Cognito.

    When you login first time you will be prompted to update your password which you can update by entering below fields and clicking 'Send' button.

    You will see the following screen once you are successfully signed-in.

  • Test a secured sample API with access token by clicking Call a Sample Proxied API:

    Note:

    Modify an URI if you want to test one of your API endpoints where access token is included in the header.

    • An endpoint of sample API is defined in oidc_frontend_backend.conf. You can add any API endpoint when you want to use an access token by referencing the following example:
        location /v1/api/example {
            auth_jwt "" token=$id_token;
            auth_jwt_key_request /_jwks_uri;        # Enable when using URL
    
            proxy_set_header Authorization "Bearer $access_token";
            proxy_pass http://my_backend_app;
            access_log /var/log/nginx/access.log oidc_jwt;
        }
  • Logout to click 'Sign out' button:

4. Stop and Remove Docker Containers

  • Stop Docker containers

    $ make down
  • Remove Docker container images

    $ make clean