ctx.Logger.Debugf("Authorization Request with id '%s' on client with id '%s' proceeding to lookup consent by challenge id '%s'",requester.GetID(),client.GetID(),userSession.ConsentChallengeID)
ctx.Logger.Errorf("Authorization Request with id '%s' on client with id '%s' could not be processed: error occurred during consent session lookup: %+v",requester.GetID(),requester.GetClient().GetID(),err)
ctx.Providers.OpenIDConnect.Fosite.WriteAuthorizeError(rw,requester,fosite.ErrServerError.WithHint("Failed to lookup consent session."))
userSession.ConsentChallengeID=nil
iferr=ctx.SaveSession(userSession);err!=nil{
ctx.Logger.Errorf("Authorization Request with id '%s' on client with id '%s' could not be processed: error occurred unlinking consent session challenge id: %+v",requester.GetID(),requester.GetClient().GetID(),err)
ctx.Logger.Errorf("Authorization Request with id '%s' on client with id '%s' could not be processed: error occurred retrieving subject for user '%s': %+v",requester.GetID(),client.GetID(),userSession.Username,err)
ctx.Providers.OpenIDConnect.Fosite.WriteAuthorizeError(rw,requester,fosite.ErrServerError.WithHint("Could not retrieve the subject."))
ctx.Logger.Errorf("Authorization Request with id '%s' on client with id '%s' could not be processed: error occurred updating consent session subject for user '%s': %+v",requester.GetID(),client.GetID(),userSession.Username,err)
ctx.Providers.OpenIDConnect.Fosite.WriteAuthorizeError(rw,requester,fosite.ErrServerError.WithHint("Could not update the consent session subject."))
ctx.Logger.Errorf("Authorization Request with id '%s' on client with id '%s' could not be processed: error occurred saving session: %+v",requester.GetID(),client.GetID(),err)
ctx.Providers.OpenIDConnect.Fosite.WriteAuthorizeError(rw,requester,fosite.ErrServerError.WithHint("Could not save the session."))
returnnil,true
}
ifconsent.Granted{
ctx.Logger.Errorf("Authorization Request with id '%s' on client with id '%s' could not be processed: this consent session with challenge id '%s' was already granted",requester.GetID(),client.GetID(),consent.ChallengeID.String())
ctx.Logger.Debugf("Authorization Request with id '%s' loaded consent session with id '%d' and challenge id '%s' for client id '%s' and subject '%s' and scopes '%s'",requester.GetID(),consent.ID,consent.ChallengeID.String(),client.GetID(),consent.Subject.String(),strings.Join(requester.GetRequestedScopes()," "))
ifconsent.IsDenied(){
ctx.Logger.Warnf("Authorization Request with id '%s' and challenge id '%s' for client id '%s' and subject '%s' and scopes '%s' was not denied by the user durng the consent session",requester.GetID(),consent.ChallengeID.String(),client.GetID(),consent.Subject.String(),strings.Join(requester.GetRequestedScopes()," "))
ctx.Logger.Errorf("Authorization Request with id '%s' on client with id '%s' had error looking up pre-configured consent sessions: %+v",requester.GetID(),requester.GetClient().GetID(),err)
ctx.Logger.Debugf("Authorization Request with id '%s' on client with id '%s' successfully looked up pre-configured consent with challenge id '%s'",requester.GetID(),client.GetID(),consent.ChallengeID)
ctx.Logger.Debugf("Authorization Request with id '%s' on client with id '%s' proceeding to generate a new consent due to unsuccessful lookup of pre-configured consent",requester.GetID(),client.GetID())
ctx.Logger.Errorf("Authorization Request with id '%s' on client with id '%s' could not be processed: error occurred generating consent: %+v",requester.GetID(),requester.GetClient().GetID(),err)
ctx.Providers.OpenIDConnect.Fosite.WriteAuthorizeError(rw,requester,fosite.ErrServerError.WithHint("Could not generate the consent session."))
ctx.Logger.Errorf("Authorization Request with id '%s' on client with id '%s' could not be processed: error occurred saving consent session: %+v",requester.GetID(),client.GetID(),err)
ctx.Providers.OpenIDConnect.Fosite.WriteAuthorizeError(rw,requester,fosite.ErrServerError.WithHint("Could not save the consent session."))
ctx.Logger.Errorf("Authorization Request with id '%s' on client with id '%s' could not be processed: error occurred saving user session for consent: %+v",requester.GetID(),client.GetID(),err)
ctx.Providers.OpenIDConnect.Fosite.WriteAuthorizeError(rw,requester,fosite.ErrServerError.WithHint("Could not save the user session."))
ctx.Logger.Debugf("Authorization Request with id '%s' on client with id '%s' authentication level '%s' is sufficient for client level '%s'",requester.GetID(),client.GetID(),authentication.LevelToString(userSession.AuthenticationLevel),authorization.LevelToPolicy(client.Policy))
ctx.Logger.Debugf("Authorization Request with id '%s' on client with id '%s' authentication level '%s' is insufficient for client level '%s'",requester.GetID(),client.GetID(),authentication.LevelToString(userSession.AuthenticationLevel),authorization.LevelToPolicy(client.Policy))
ctx.Logger.Debugf("Authorization Request with id '%s' on client with id '%s' is being redirected to '%s'",requester.GetID(),client.GetID(),destination)
ctx.Logger.Debugf("Consent Session checked for pre-configuration with signature of client id '%s' and subject '%s' failed with error during load: %+v",clientID,subject,err)
returnnil,err
}
deferfunc(){
iferr:=rows.Close();err!=nil{
ctx.Logger.Errorf("Consent Session checked for pre-configuration with signature of client id '%s' and subject '%s' failed to close rows with error: %+v",clientID,subject,err)
}
}()
forrows.Next(){
ifconsent,err=rows.Get();err!=nil{
ctx.Logger.Debugf("Consent Session checked for pre-configuration with signature of client id '%s' and subject '%s' failed with error during iteration: %+v",clientID,subject,err)
ctx.Logger.Debugf("Consent Session checked for pre-configuration with signature of client id '%s' and subject '%s' found a result with challenge id '%s'",clientID,subject,consent.ChallengeID)
returnconsent,nil
}
ctx.Logger.Debugf("Consent Session checked for pre-configuration with signature of client id '%s' and subject '%s' did not find any results",clientID,subject)