auth
auth copied to clipboard
Authenticator via oauth2, direct, email and telegram
Added type safety for builtin providers names
Based on https://github.com/go-pkgz/auth/pull/193 by @freddierice. Please merge with rebase so the commit author will be preserved.
This patch gives a possibility to configure custom HTTP handlers, which can change the default authentication error responses in the middlewares. The default implementation uses `http.Error()` method, which produces content...
Using `NewCustomServer` how can use `MapUserFn`? https://github.com/go-pkgz/auth/blob/4e32f30d2628c11f9104b1467c8d82cf968228dd/v2/provider/custom_server.go#L49 to be able to do something like https://github.com/go-pkgz/auth/blob/78537e6f812df08d95ae8a5f9c049dfb59247b2e/v2/provider/providers.go#L33 My problem using a customServer, i am blocked with an error `provider is not allowed`....
README.md states that the project is still in active development (i.e. below semver 1.0.0). However, version 1.24.2 is already released on GitHub Releases. Would've made a PR, but I don't...
The problem occurs when the provider name contains underscore characters `_`. If provider name is like `provider_prod` and full `claims.User.ID` in the JWT token looks like `provider_prod_user1`, then [Authenticator.isProviderAllowed()](https://github.com/go-pkgz/auth/blob/master/v2/middleware/auth.go#L156-L167) check...
Please consider configuring Dependabot https://github.com/szepeviktor/go-auth/blob/b85253300dacac1b538fb55a4b9f128055969323/.github/dependabot.yml#L1-L10 There are very old GHA actions: https://github.com/szepeviktor/go-auth/pull/1/files