greenpau / caddy-security

🔐 Authentication, Authorization, and Accounting (AAA) App and Plugin for Caddy v2. 💎 Implements Form-Based, Basic, Local, LDAP, OpenID Connect, OAuth 2.0 (Github, Google, Facebook, Okta, etc.), SAML Authentication. MFA/2FA with App Authenticators and Yubico. 💎 Authorization with JWT/PASETO tokens. 🔐
https://authcrunch.com/
Apache License 2.0
1.42k stars 70 forks source link

breakfix: Azure OAuth2 config not working #318

Closed MrSuttonmann closed 7 months ago

MrSuttonmann commented 7 months ago

Describe the issue

I’ve followed the documentation for setting up an Azure OAuth2 IdP. When I run my pipeline to validate the Caddyfile, I get the following error:

Error: loading http app module: provision http: server srv0: setting up route handlers: route 0: loading handler modules: position 0: loading module 'subroute': provision http.handlers.subroute: setting up subroutes: route 1: loading handler modules: position 0: loading module 'subroute': provision http.handlers.subroute: setting up subroutes: route 1: loading handler modules: position 1: loading module 'authentication': provision http.handlers.authentication: loading authentication providers: module name 'authorizer': provision http.authentication.providers.authorizer: loading security app module: provision security: server initialization failed: failed configuring identity provider: failed to fetch metadata for OAuth 2.0 authorization server: metadata authorization_endpoint field not found for provider azure

Configuration

Paste full Caddyfile below:

Removed

Version Information

Provide output of caddy list-modules -versions | grep git below:


Error: unknown shorthand flag: 'v' in -versions

Expected behavior

I expect the configuration to work!

Additional context

Add any other context about the problem here.

MrSuttonmann commented 7 months ago

The issue was due to blank environment variables.

abirvepete commented 6 months ago

what is meaning of blank nvironment variables? I try The Microsoft oauth2.0 recently, i Compare The part Which is Microsoft of the documentation. the blank nvironment variables is meaing that we not set the metadata authorization_endpoint ?

greenpau commented 6 months ago

what is meaning of blank nvironment variables?

@abirvepete , it is likely the environment variables were not set.