Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(example): add supported signing algorithms to RP #639

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion example/client/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"sync/atomic"
"time"

"github.com/go-jose/go-jose/v4"
"github.com/google/uuid"
"github.com/sirupsen/logrus"

Expand Down Expand Up @@ -53,7 +54,23 @@ func main() {

options := []rp.Option{
rp.WithCookieHandler(cookieHandler),
rp.WithVerifierOpts(rp.WithIssuedAtOffset(5 * time.Second)),
rp.WithVerifierOpts(
rp.WithIssuedAtOffset(5*time.Second),
// When the OP uses other signing algorithms then RS256,
// We need to tell the RP to accept them.
// The actual handshake is done with the "kid" and "alg" header claims.
// However, [jose.ParseSigned] needs a list of algorithms we are willing to accept.
// This example sets all the algorithms the ZITADEL product supports.
rp.WithSupportedSigningAlgorithms(
string(jose.EdDSA),
string(jose.RS256),
string(jose.RS384),
string(jose.RS512),
string(jose.ES256),
string(jose.ES384),
string(jose.ES512),
),
),
rp.WithHTTPClient(client),
rp.WithLogger(logger),
}
Expand Down
Loading