mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 06:07:33 +00:00
Merge commit from fork
* fix: prevent intent token reuse and add expiry * fix duplicate * fix expiration
This commit is contained in:
@@ -3,6 +3,7 @@ package azuread
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/zitadel/oidc/v3/pkg/client/rp"
|
||||
httphelper "github.com/zitadel/oidc/v3/pkg/http"
|
||||
@@ -12,6 +13,8 @@ import (
|
||||
"github.com/zitadel/zitadel/internal/idp/providers/oauth"
|
||||
)
|
||||
|
||||
var _ idp.Session = (*Session)(nil)
|
||||
|
||||
// Session extends the [oauth.Session] to be able to handle the id_token and to implement the [idp.SessionSupportsMigration] functionality
|
||||
type Session struct {
|
||||
*Provider
|
||||
@@ -79,6 +82,13 @@ func (s *Session) FetchUser(ctx context.Context) (user idp.User, err error) {
|
||||
return user, nil
|
||||
}
|
||||
|
||||
func (s *Session) ExpiresAt() time.Time {
|
||||
if s.OAuthSession == nil {
|
||||
return time.Time{}
|
||||
}
|
||||
return s.OAuthSession.ExpiresAt()
|
||||
}
|
||||
|
||||
// Tokens returns the [oidc.Tokens] of the underlying [oauth.Session].
|
||||
func (s *Session) Tokens() *oidc.Tokens[*oidc.IDTokenClaims] {
|
||||
return s.oauth().Tokens
|
||||
|
Reference in New Issue
Block a user