mirror of
https://github.com/janishutz/oidclogin.git
synced 2026-10-08 17:26:20 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9ca3abb6c |
@@ -29,13 +29,19 @@ var (
|
|||||||
defaultRedirect string
|
defaultRedirect string
|
||||||
)
|
)
|
||||||
|
|
||||||
// Configure and set up the login SDK. The user_function is used to create or update a user
|
// Wraps the normal configure function, but also gives you access to change the User Function, which is called upon login.
|
||||||
func Configure(r *gin.Engine, app_url string, default_redirect string, user_function UserFunc, stubs_on_unconfigured bool) {
|
// It is used to create or update a user.
|
||||||
|
func ConfigureFull(r *gin.Engine, app_url string, default_redirect string, user_function UserFunc, stubs_on_unconfigured bool) {
|
||||||
|
userFunc = user_function
|
||||||
|
Configure(r, app_url, default_redirect, stubs_on_unconfigured)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Configure and set up the login SDK
|
||||||
|
func Configure(r *gin.Engine, app_url string, default_redirect string, stubs_on_unconfigured bool) {
|
||||||
issuer := os.Getenv("OIDC_ISSUER")
|
issuer := os.Getenv("OIDC_ISSUER")
|
||||||
clientID := os.Getenv("OIDC_CLIENT_ID")
|
clientID := os.Getenv("OIDC_CLIENT_ID")
|
||||||
clientSecret := os.Getenv("OIDC_CLIENT_SECRET")
|
clientSecret := os.Getenv("OIDC_CLIENT_SECRET")
|
||||||
defaultRedirect = default_redirect
|
defaultRedirect = default_redirect
|
||||||
userFunc = user_function
|
|
||||||
|
|
||||||
if issuer == "" || clientID == "" || clientSecret == "" {
|
if issuer == "" || clientID == "" || clientSecret == "" {
|
||||||
if stubs_on_unconfigured {
|
if stubs_on_unconfigured {
|
||||||
|
|||||||
Reference in new issue
Block a user