mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-30 23:09:23 +02:00
Prototype device authorization flow (core)
This commit is contained in:
parent
229ef72e58
commit
56ce79e662
13 changed files with 333 additions and 26 deletions
|
@ -342,6 +342,17 @@ func (s *Stateful) AuthenticateSignInURL(
|
|||
return redirectTo, nil
|
||||
}
|
||||
|
||||
func (s *Stateful) AuthenticateDeviceCode(w http.ResponseWriter, r *http.Request, params url.Values) error {
|
||||
deviceAuthURL := s.authenticateURL.ResolveReference(&url.URL{
|
||||
Path: "/.pomerium/device_auth",
|
||||
RawQuery: params.Encode(),
|
||||
})
|
||||
|
||||
signedURL := urlutil.NewSignedURL(s.sharedKey, deviceAuthURL)
|
||||
httputil.Redirect(w, r, signedURL.String(), http.StatusFound)
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetIdentityProviderIDForURLValues returns the identity provider ID
|
||||
// associated with the given URL values.
|
||||
func (s *Stateful) GetIdentityProviderIDForURLValues(vs url.Values) string {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue