mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-24 13:38:17 +02:00
authenticate: make callback path configurable (#493)
Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
This commit is contained in:
parent
1901cb5ca0
commit
5716113c2a
6 changed files with 57 additions and 26 deletions
|
@ -27,8 +27,6 @@ import (
|
|||
"github.com/pomerium/pomerium/internal/urlutil"
|
||||
)
|
||||
|
||||
const callbackPath = "/oauth2/callback"
|
||||
|
||||
// ValidateOptions checks that configuration are complete and valid.
|
||||
// Returns on first error found.
|
||||
func ValidateOptions(o config.Options) error {
|
||||
|
@ -47,6 +45,9 @@ func ValidateOptions(o config.Options) error {
|
|||
if o.ClientSecret == "" {
|
||||
return errors.New("authenticate: 'IDP_CLIENT_SECRET' is required")
|
||||
}
|
||||
if o.AuthenticateCallbackPath == "" {
|
||||
return errors.New("authenticate: 'AUTHENTICATE_CALLBACK_PATH' is required")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -149,7 +150,7 @@ func New(opts config.Options) (*Authenticate, error) {
|
|||
headerStore := header.NewStore(encryptedEncoder, "Pomerium")
|
||||
|
||||
redirectURL, _ := urlutil.DeepCopy(opts.AuthenticateURL)
|
||||
redirectURL.Path = callbackPath
|
||||
redirectURL.Path = opts.AuthenticateCallbackPath
|
||||
// configure our identity provider
|
||||
provider, err := identity.New(
|
||||
opts.Provider,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue