mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-20 01:58:10 +02:00
support both stateful and stateless authenticate
Update the initialization logic for the authenticate, authorize, and proxy services to automatically select between the stateful authentication flow and the stateless authentication flow, depending on whether Pomerium is configured to use the hosted authenticate service.
This commit is contained in:
parent
c01d0e045d
commit
f7dc76c6e5
6 changed files with 51 additions and 12 deletions
|
@ -827,6 +827,16 @@ func (o *Options) GetInternalAuthenticateURL() (*url.URL, error) {
|
|||
return urlutil.ParseAndValidateURL(o.AuthenticateInternalURLString)
|
||||
}
|
||||
|
||||
// UseStatelessAuthenticateFlow returns true if the stateless authentication
|
||||
// flow should be used (i.e. for hosted authenticate).
|
||||
func (o *Options) UseStatelessAuthenticateFlow() bool {
|
||||
u, err := o.GetInternalAuthenticateURL()
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
return urlutil.IsHostedAuthenticateDomain(u.Hostname())
|
||||
}
|
||||
|
||||
// GetAuthorizeURLs returns the AuthorizeURLs in the options or 127.0.0.1:5443.
|
||||
func (o *Options) GetAuthorizeURLs() ([]*url.URL, error) {
|
||||
if IsAll(o.Services) && o.AuthorizeURLString == "" && len(o.AuthorizeURLStrings) == 0 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue