feat: new endpoints(/login, /userinfo, /v2/logout) and a bundle OIDC simulation environment #57
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Issue Item:
Background:
/loginand/userinfoendpoints for client apps (SPA) to interact with./loginfunction as part of relying party when a user clicks on login button from the landing page./userinfofunction as part of relying party when a user wants to verify the session cookie created by NGINX Plus is still valid or to get some user info about users which is needed for the Client Apps./logoutfunction is required to extend the sign-off function on the IdP'send_session_endpoint. Afterwards the NGINX Plus' logout redirection URI (which is redirected by IdP after successful logout from IdP) can clear session cookies and redirect to the either original landing page or a custom logout page.Description:
Added
/userinfoendpoint:$oidc_userinfo_endpointas same as authz and token endpoints here (openid_connect_configuration.conf) ./userinfoendpoint here(openid_connect.server_conf) in a location block of NGINX Plus to interact with IdP'suserinfo_endpointwhich is defined in the endpoint ofwell-known/openid-configuration.userinfo_endpointby addingaccess_tokenas a bearer token.Exposed
/loginendpoint:/loginendpoint as a location block here (openid_connect.server_conf)authorization_endpointconfigured in the map variable of$oidc_authz_endpointin (openid_connect_configuration.conf).Exposed
/v2/logoutendpoint or enhance/logoutendpoint:Add a map variable of
$oidc_end_session_endpointas same as authz and token endpoints here (openid_connect_configuration.conf) .Add a map of
$post_logout_return_uri: After the successful logout from the IdP, NGINX Plus calls this URI to redirect to either the original page or a custom logout page. The default is original page based on the configuration of$redirect_base.Exposed endpoints of
/v2/logoutand/v2/_logout/v2/logout: NGINX Plus calls IdP's end session endpoint ($oidc_end_session_endpoint) to finish the session by IdP./v2/_logout(Callback endpoint):FYI. We can just enhance endpoints of
/logoutand/_logoutwithout adding new endpoints of/v2/logoutand/v2/_outif this doesn't block the existing customer, and if they can update this reference implementation in their configuration:/v2/logout&/v2/_logoutto/logoutand/_logout.Capture logout endpoint (
oidc_logout_endpointof IDP in a map variable as same as authz and token endpoints here (openid_connect_configuration.conf).Added a bundle SPA to simulate OIDC.
LoginbuttonLogoutbuttonCall a proxied APIbutton by adding a sample API endpoint to test an API resource usingaccess tokenthat is received by IDP.Added a Docker container environment to locally simulate OIDC.

Added a doc of how to set up and locally test OIDC here.
Assumptions:
$oidc_logout_redirect_uriat the time of creating the resource credentials along with/_codexch.