Search code examples
nginxokta

Okta SSO/SAML with nginx for static page


I was wondering if there was an easy way to setup nginx with Okta authentication for a simple static site served behind nginx.

I can across this link https://github.com/dalehamel/okta-auth-proxy but it doesn't have any installation instructions and I am a newbie at nginx.

Any help would be appreciated!


Solution

  • First you should have a configuration set up without authentication.Assuming you have that, I found this and got it to work: https://hub.docker.com/r/tomsmithokta/nginx-oss-okta which is entirely based on the lua-resty-openidc. The fact that it was already built was helpful for me though.

    First configure your Okta app in the Okta web GUI then fill in the proper fields that are not commented out in the NGINX example conf. The only caveat is to uncomment the redirect_uri and fill that in but instead comment out or remove the redirect_uri_path which is a deprecated field. All the other things in the config are parameters you can play with or just accept them as is.

    By default it passes you onto a headers page but if you adjust the proxy_pass field you should be able to pass it to your app.