Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Nginx open source support OpenID and JWT

I have a basic Nginx docker image, acting as a reverse-proxy, that currently uses basic authentication sitting in front of my application server. I'm looking for a way to integrate it with our SSO solution in development that uses JWT, but all of the documentation says it requires Nginx+. So, is it possible to do JWT validation inside of open-sourced Nginx, or do I need the paid version?

like image 601
Connor Campbell Avatar asked Mar 15 '19 18:03

Connor Campbell


2 Answers

Sure, there are open source codes, which you can use and customize for your case (example).

IMHO there are better implementations, which you can use as an "auth proxy" in front of your application. My favorite is keycloak-gatekeeper (you can use it with any OpenID IdP, not only with the Keycloak), which can provide authentication, authorization, token encryption, refresh token implementation, small footprint, ...

like image 126
Jan Garaj Avatar answered Nov 01 '22 05:11

Jan Garaj


There's also lua-resty-openidc: https://github.com/zmartzone/lua-resty-openidc

lua-resty-openidc is a library for NGINX implementing the OpenID Connect Relying Party (RP) and/or the OAuth 2.0 Resource Server (RS) functionality.

When used as an OpenID Connect Relying Party it authenticates users against an OpenID Connect Provider using OpenID Connect Discovery and the Basic Client Profile (i.e. the Authorization Code flow). When used as an OAuth 2.0 Resource Server it can validate OAuth 2.0 Bearer Access Tokens against an Authorization Server or, in case a JSON Web Token is used for an Access Token, verification can happen against a pre-configured secret/key .

like image 41
Hans Z. Avatar answered Nov 01 '22 04:11

Hans Z.