MCPcopy Create free account
hub / github.com/auth0/auth0-cli / DetermineSigningAlgorithm

Function DetermineSigningAlgorithm

internal/auth/auth.go:332–343  ·  view source on GitHub ↗

DetermineSigningAlgorithm returns the appropriate JWA signature algorithm based on the string representation.

(alg string)

Source from the content-addressed store, hash-verified

330
331// DetermineSigningAlgorithm returns the appropriate JWA signature algorithm based on the string representation.
332func DetermineSigningAlgorithm(alg string) (jwa.SignatureAlgorithm, error) {
333 switch alg {
334 case "RS256":
335 return jwa.RS256, nil
336 case "RS384":
337 return jwa.RS384, nil
338 case "PS256":
339 return jwa.PS256, nil
340 default:
341 return "", fmt.Errorf("unsupported client assertion algorithm %q", alg)
342 }
343}
344
345// CreateClientAssertion creates a JWT token for client authentication with the specified lifetime.
346func CreateClientAssertion(alg jwa.SignatureAlgorithm, signingKey, clientID, audience string) (string, error) {

Callers 1

TokenMethod · 0.85

Calls 1

ErrorfMethod · 0.80

Tested by

no test coverage detected