Enhance the NJS Code to capture the access_token sent by the IdP.
Store the access_token in the k/v store as same as we store id_token and refresh_token
2. new endpoints
Add /userinfo endpoint:
Add a map variable of $oidc_userinfo_endpoint as same as authz and token endpoints here (openid_connect_configuration.conf) .
Expose /userinfo endpoint here(openid_connect.server_conf) in a location block of NGINX Plus to interact with IdP's userinfo_endpoint which is defined in the endpoint ofwell-known/openid-configuration.
The nginx location block should proxy to the IdP’s userinfo_endpoint by adding access_token as a bearer token.
Authorization : Bearer <access_token>
The response coming from IdP should be returned back to the caller as it is.
Expose /login endpoint:
Expose the /login endpoint as a location block here (openid_connect.server_conf)
Proxy it to the IdP's authorization_endpoint configured in the map variable of $oidc_authz_endpoint in (openid_connect_configuration.conf).
This would outsource the login function to IdP as its configured.
Enhance /logout endpoint:
Add a map variable of $oidc_end_session_endpoint as same as authz and token endpoints here (openid_connect_configuration.conf) .
Proxy it to the IdP's end_session_endpoint to finish the session by IdP.
Add a custom query params so that customers can add more parameters.
Enhance /_logout endpoint:
Enhance /_logout endpoint which is a callback from IdP as a location block here (openid_connect.server_conf) to handle the following sequences.
Redirected by IdP when IdP successfully finished the session.
NGINX Plus: Clear session cookies.
NGINX Plus: Redirect to either the landing page or the custom logout page by calling
3. add endpoints in configure.sh
IdP's userinfo endpoint
IdP's end session endpoint
Compatibility:
This PR does not block the existing customers as it just adds endpoints and features.
Thanks for your review in detail for the PR. It was accidentally closed. The new commit has been submitted based on your review. I would appreciate it if you could review it and give me feedback when you get a chance.
For you to easily manage this repo to reduce any concerns from the enhancements based on the reviews on the PR, I have divided a big PR into small PRs as the following example.
Issue Item:
Description:
1. access token
access_token
sent by the IdP.access_token
in the k/v store as same as we storeid_token
andrefresh_token
2. new endpoints
Add
/userinfo
endpoint:$oidc_userinfo_endpoint
as same as authz and token endpoints here (openid_connect_configuration.conf
) ./userinfo
endpoint here(openid_connect.server_conf
) in a location block of NGINX Plus to interact with IdP'suserinfo_endpoint
which is defined in the endpoint ofwell-known/openid-configuration
.userinfo_endpoint
by addingaccess_token
as a bearer token.Expose
/login
endpoint:/login
endpoint as a location block here (openid_connect.server_conf
)authorization_endpoint
configured in the map variable of$oidc_authz_endpoint
in (openid_connect_configuration.conf
).Enhance
/logout
endpoint:$oidc_end_session_endpoint
as same as authz and token endpoints here (openid_connect_configuration.conf
) .end_session_endpoint
to finish the session by IdP.Enhance
/_logout
endpoint:/_logout
endpoint which is a callback from IdP as a location block here (openid_connect.server_conf
) to handle the following sequences.3. add endpoints in
configure.sh
Compatibility: