token, errors and more
This commit is contained in:
parent
89bcd1a0c3
commit
f04e7cf5b9
9 changed files with 64 additions and 24 deletions
|
@ -2,6 +2,7 @@ package op
|
|||
|
||||
import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/gorilla/schema"
|
||||
|
||||
|
@ -22,6 +23,7 @@ var (
|
|||
IntrospectionEndpoint: defaultIntrospectEndpoint,
|
||||
Userinfo: defaultUserinfoEndpoint,
|
||||
}
|
||||
DefaultIDTokenValidity = time.Duration(5 * time.Minute)
|
||||
)
|
||||
|
||||
type DefaultOP struct {
|
||||
|
@ -36,7 +38,8 @@ type DefaultOP struct {
|
|||
}
|
||||
|
||||
type Config struct {
|
||||
Issuer string
|
||||
Issuer string
|
||||
IDTokenValidity time.Duration
|
||||
// ScopesSupported: oidc.SupportedScopes,
|
||||
// ResponseTypesSupported: responseTypes,
|
||||
// GrantTypesSupported: oidc.SupportedGrantTypes,
|
||||
|
@ -172,6 +175,13 @@ func (p *DefaultOP) Signer() Signer {
|
|||
// return
|
||||
}
|
||||
|
||||
func (p *DefaultOP) IDTokenValidity() time.Duration {
|
||||
if p.config.IDTokenValidity == 0 {
|
||||
p.config.IDTokenValidity = DefaultIDTokenValidity
|
||||
}
|
||||
return p.config.IDTokenValidity
|
||||
}
|
||||
|
||||
// func (p *DefaultOP) ErrorHandler() func(w http.ResponseWriter, r *http.Request, authReq *oidc.AuthRequest, err error) {
|
||||
// return AuthRequestError
|
||||
// }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue