diff options
| author | mo khan <mo@mokhan.ca> | 2025-04-25 21:38:21 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-04-28 09:07:31 -0600 |
| commit | cae83cf2991c82e07f02e3a9c6c350be1c815941 (patch) | |
| tree | 33cfa6abfe85ca521f9b77f2943f7c34eb612a83 /pkg | |
| parent | 8a3ec933d5f8c867e2826c30c0c87a2f89fd73fc (diff) | |
refactor: extract method to validate id token
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/oidc/oidc.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/oidc/oidc.go b/pkg/oidc/oidc.go index b82570b..5ff8c28 100644 --- a/pkg/oidc/oidc.go +++ b/pkg/oidc/oidc.go @@ -33,3 +33,9 @@ func New(ctx context.Context, issuer string, clientID, clientSecret, callbackURL }, }, nil } + +func (o *OpenID) ValidateIDToken(ctx context.Context, rawIDToken RawToken) (*IDToken, error) { + verifier := o.Provider.VerifierContext(ctx, o.OIDCConfig) + idToken, err := verifier.Verify(ctx, rawIDToken.String()) + return idToken, err +} |
