midarrlabs / midarr-server

🔥Midarr, the minimal lightweight media server.
MIT License
1.22k stars 39 forks source link

Add OIDC #374

Closed trueChazza closed 1 year ago

trueChazza commented 1 year ago

Add OIDC

trueChazza commented 1 year ago

@onedr0p I've just started with GitHub provider for now to flesh out the approach - then I'll adjust to suit generic identity provider i.e. Authelia, Authentik etc

trueChazza commented 1 year ago

@onedr0p - here's a first pass build on oauth. Please give it a run through, and let me know how it goes 😄

v3.2.0-beta.2

http://midarr:4000/auth/authentik - go to this url to auth with Authentik.

OAUTH_ISSUER_URL=http://localhost:9000
OAUTH_AUTHORIZE_URL=http://localhost:9000/application/o/authorize/
OAUTH_TOKEN_URL=http://server-authentik:9000/application/o/token/
OAUTH_CLIENT_ID=someClientId
OAUTH_CLIENT_SECRET=someClientSecret
OAUTH_REDIRECT_URI=http://localhost:4000/auth/authentik/callback
OAUTH_USER_URL=http://server-authentik:9000/application/o/userinfo/
onedr0p commented 1 year ago

@trueChazza oauth is generic and doesn't matter if it is (for example) authelia/authentik, so your provider should probably be called oauth generic/custom.

Take a look at the grafana docs on how they allow people to configure this...

https://grafana.com/docs/grafana/latest/setup-grafana/configure-security/configure-authentication/generic-oauth/

Also it might be helpful to look at the docs on Authelia and see how they allow you to configure applications to use OIDC, on the left you can choose an app to see more how it is configured... e.g. BookStack or the many other examples on there like grafana

https://www.authelia.com/integration/openid-connect/introduction/

trueChazza commented 1 year ago

@trueChazza oauth is generic and doesn't matter if it is (for example) authelia/authentik, so your provider should probably be called oauth generic/custom.

Take a look at the grafana docs on how they allow people to configure this...

https://grafana.com/docs/grafana/latest/setup-grafana/configure-security/configure-authentication/generic-oauth/

Also it might be helpful to look at the docs on Authelia and see how they allow you to configure applications to use OIDC, on the left you can choose an app to see more how it is configured... e.g. BookStack or the many other examples on there like grafana

https://www.authelia.com/integration/openid-connect/introduction/

Awesome thank you for this!