clean-mouse-35824
11/24/2020, 7:56 PMclean-mouse-35824
11/25/2020, 11:49 AMclean-mouse-35824
11/25/2020, 11:51 AMhigh-optician-2097
clean-mouse-35824
11/25/2020, 11:54 AMhigh-optician-2097
clean-mouse-35824
11/25/2020, 12:08 PMclean-mouse-35824
11/25/2020, 12:15 PMfunc (f *Fosite) NewAccessRequest(ctx context.Context, r *http.Request, session Session) (AccessRequester, error) {
client, err := f.AuthenticateClient(ctx, r, r.PostForm)
if err != nil {
return accessRequest, err
}
accessRequest.Client = client
var found = false
for _, loader := range f.TokenEndpointHandlers {
if err := loader.HandleTokenEndpointRequest(ctx, accessRequest); err == nil {
found = true
} else if <http://errors.Is|errors.Is>(err, ErrUnknownRequest) {
// do nothing
} else if err != nil {
return accessRequest, err
}
}
if !found {
return nil, errorsx.WithStack(ErrInvalidRequest)
}
return accessRequest, nil
}
After my suggested changes
func (f *Fosite) NewAccessRequest(ctx context.Context, r *http.Request, session Session) (AccessRequester, error) {
for _, loader := range f.TokenEndpointHandlers {
if !loader.CanHandlerRequest(ctx, accessRequest) {
continue
}
if loader.IsClientAuthRequired() {
client, err := f.AuthenticateClient(ctx, r, r.PostForm)
if err != nil {
return accessRequest, err
}
accessRequest.Client = client
}
if err := loader.HandleTokenEndpointRequest(ctx, accessRequest); err == nil {
return accessRequest, err
}
return accessRequest, nil
}
return nil, errorsx.WithStack(ErrInvalidRequest)
}clean-mouse-35824
11/25/2020, 12:22 PMhigh-optician-2097
high-optician-2097
loader.CanSkipClientAuth !clean-mouse-35824
11/25/2020, 12:37 PMclean-mouse-35824
11/25/2020, 12:38 PMclean-mouse-35824
11/25/2020, 12:40 PMhigh-optician-2097
high-optician-2097
high-optician-2097
high-optician-2097
clean-mouse-35824
11/25/2020, 1:31 PMclean-mouse-35824
11/25/2020, 1:35 PMfor _, loader := range f.TokenEndpointHandlers {
if err := loader.HandleTokenEndpointRequest(ctx, accessRequest); err == nil {
found = true
} else if <http://errors.Is|errors.Is>(err, ErrUnknownRequest) {
// do nothing
} else if err != nil {
return accessRequest, err
}
}
In original code i see, that even if some token endpoint is executed, we still continue to iterate over all endpoints, so it is possible to execute two or more endpoints at the same time. In oauth 2.0 flow it does not make sense. I think only one endpoint should be executed per request, but maybe i am missing some point. Should i preserve this logic or no?clean-mouse-35824
11/26/2020, 4:19 PMclean-mouse-35824
11/27/2020, 9:46 AMtype JWTAuthGrantStorage interface {
GetPublicKey(ctx context.Context, issuer string, subject string, keyId string) (interface{}, error)
GetPublicKeys(ctx context.Context, issuer string, subject string) ([]interface{}, error)
GetPublicKeyScopes(ctx context.Context, issuer string, subject string, keyId string) ([]string, error)
}
What do you think?high-optician-2097
GetPublicKeyScopes be used for?clean-mouse-35824
11/27/2020, 10:24 AMhigh-optician-2097
clean-mouse-35824
11/27/2020, 11:18 AMclean-mouse-35824
11/27/2020, 11:22 AMhigh-optician-2097
clean-mouse-35824
12/04/2020, 1:40 PMtype Session interface {
// SetExpiresAt sets the expiration time of a token.
//
// session.SetExpiresAt(fosite.AccessToken, time.Now().UTC().Add(time.Hour))
SetExpiresAt(key TokenType, exp time.Time)
// GetExpiresAt returns the expiration time of a token if set, or time.IsZero() if not.
//
// session.GetExpiresAt(fosite.AccessToken)
GetExpiresAt(key TokenType) time.Time
// GetUsername returns the username, if set. This is optional and only used during token introspection.
GetUsername() string
// GetSubject returns the subject, if set. This is optional and only used during token introspection.
GetSubject() string
// Clone clones the session.
Clone() Session
}
I need method to set subject, but interface don't have it.high-optician-2097
clean-mouse-35824
12/04/2020, 2:03 PMclean-mouse-35824
12/04/2020, 2:04 PMhigh-optician-2097
high-optician-2097
clean-mouse-35824
12/04/2020, 2:28 PMclean-mouse-35824
12/04/2020, 2:28 PMclean-mouse-35824
12/07/2020, 2:03 PMhigh-optician-2097
clean-mouse-35824
12/07/2020, 3:53 PMclean-mouse-35824
12/07/2020, 3:55 PMtype JWTAuthGrantStorage interface {
// GetPublicKey returns public key, issued by 'issuer', and assigned for subject. Public key is used to check
// signature of jwt assertion in authorization grants.
GetPublicKey(ctx context.Context, issuer string, subject string, keyId string) (*jose.JSONWebKey, error)
// GetPublicKeys returns public key, set issued by 'issuer', and assigned for subject.
GetPublicKeys(ctx context.Context, issuer string, subject string) (*jose.JSONWebKeySet, error)
// GetPublicKeyScopes returns assigned scope for assertion, identified by public key, issued by 'issuer'.
GetPublicKeyScopes(ctx context.Context, issuer string, subject string, keyId string) ([]string, error)
}clean-mouse-35824
12/07/2020, 3:57 PMhigh-optician-2097
clean-mouse-35824
12/08/2020, 10:38 AMclean-mouse-35824
12/08/2020, 10:40 AMhigh-optician-2097
issuers API do? Does it set the scope and subject of the resulting access token?high-optician-2097
high-optician-2097
high-optician-2097
clean-mouse-35824
12/08/2020, 10:43 AMIssuers api will let us create trusted issuers with their public keys. Basically bind public key to issuer, subject and scopes.clean-mouse-35824
12/08/2020, 10:44 AMclean-mouse-35824
12/08/2020, 10:46 AMclean-mouse-35824
12/08/2020, 10:48 AMhigh-optician-2097
high-optician-2097
clean-mouse-35824
12/08/2020, 10:59 AMclean-mouse-35824
12/08/2020, 11:00 AMhigh-optician-2097
high-optician-2097
clean-mouse-35824
12/08/2020, 11:18 AMclean-mouse-35824
12/08/2020, 1:37 PMhigh-optician-2097
clean-mouse-35824
12/08/2020, 1:45 PMclean-mouse-35824
12/14/2020, 11:10 AMclean-mouse-35824
12/14/2020, 11:10 AMhigh-optician-2097
clean-mouse-35824
01/19/2021, 5:16 PMhigh-optician-2097
clean-mouse-35824
01/19/2021, 5:18 PMclean-mouse-35824
01/22/2021, 8:54 AMhigh-optician-2097
high-optician-2097
clean-mouse-35824
01/22/2021, 9:03 AMclean-mouse-35824
01/22/2021, 9:03 AMhigh-optician-2097
clean-mouse-35824
01/22/2021, 9:19 AMclean-mouse-35824
01/26/2021, 11:53 AMhigh-optician-2097
clean-mouse-35824
02/03/2021, 12:31 PMhigh-optician-2097
clean-mouse-35824
02/03/2021, 12:34 PMhigh-optician-2097
clean-mouse-35824
02/03/2021, 12:37 PMhigh-optician-2097
clean-mouse-35824
02/03/2021, 12:39 PMhigh-optician-2097
clean-mouse-35824
02/03/2021, 12:39 PMclean-mouse-35824
02/03/2021, 12:39 PMhigh-optician-2097
clean-mouse-35824
02/03/2021, 12:40 PMclean-mouse-35824
02/03/2021, 12:40 PMclean-mouse-35824
02/03/2021, 12:41 PMhigh-optician-2097
high-optician-2097
high-optician-2097
clean-mouse-35824
02/05/2021, 9:19 AMhigh-optician-2097
high-optician-2097
high-optician-2097
clean-mouse-35824
02/05/2021, 10:22 AMclean-mouse-35824
02/05/2021, 10:23 AMhigh-optician-2097
clean-mouse-35824
02/05/2021, 10:28 AMhigh-optician-2097
high-optician-2097
clean-mouse-35824
02/05/2021, 10:36 AMclean-mouse-35824
02/05/2021, 10:36 AMhigh-optician-2097
high-optician-2097
clean-mouse-35824
02/05/2021, 1:10 PMhigh-optician-2097
clean-mouse-35824
02/05/2021, 1:11 PMhigh-optician-2097
high-optician-2097
high-optician-2097
high-optician-2097
clean-mouse-35824
02/05/2021, 4:36 PMclean-mouse-35824
02/05/2021, 4:37 PMclean-mouse-35824
02/05/2021, 4:37 PMclean-mouse-35824
02/05/2021, 4:38 PMhigh-optician-2097
clean-mouse-35824
03/05/2021, 1:04 PMhigh-optician-2097
clean-mouse-35824
03/05/2021, 4:30 PMhigh-optician-2097
clean-mouse-35824
03/10/2021, 12:46 PMhigh-optician-2097
clean-mouse-35824
05/25/2021, 12:28 PMMake sdk - but it changes a lot of files 🤯high-optician-2097
clean-mouse-35824
05/25/2021, 12:52 PMclean-mouse-35824
06/11/2021, 1:17 PMhigh-optician-2097
clean-mouse-35824
06/11/2021, 1:34 PMclean-mouse-35824
11/07/2021, 9:19 PMmake sdk no longer works in Makefile in Hydra, because this file bash <(curl <https://raw.githubusercontent.com/ory/cli/master/install.sh>) -b .bin v0.0.72 looks like no longer exists, how can make to work it again?high-optician-2097
high-optician-2097
high-optician-2097
clean-mouse-35824
11/08/2021, 8:39 AMclean-mouse-35824
11/30/2021, 4:26 PMclean-mouse-35824
12/16/2021, 1:14 PMhigh-optician-2097
clean-mouse-35824
12/16/2021, 1:20 PMclean-mouse-35824
12/24/2021, 4:22 PMclean-mouse-35824
12/24/2021, 4:23 PMhigh-optician-2097
clean-mouse-35824
12/24/2021, 4:36 PM