github XenitAB/go-oidc-middleware v0.0.16

latest releases: oidcgin/v0.0.32, oidcechojwt/v0.0.32, oidchttp/v0.0.32...
2 years ago

Changes

  • Add ability to use custom error handler (#75)

Additional information

It is possible to add a custom function to handle errors. It will not be possible to change anything using it, but you will be able to add logic for logging as an example.

errorHandler := func(description options.ErrorDescription, err error) {
	fmt.Printf("Description: %s\tError: %v\n", description, err)
}

oidcHandler := oidcgin.New(
	options.WithIssuer(cfg.Issuer),
	options.WithFallbackSignatureAlgorithm(cfg.FallbackSignatureAlgorithm),
	options.WithRequiredClaims(map[string]interface{}{
		"cid": cfg.ClientID,
	}),
	options.WithErrorHandler(errorHandler),
)

Don't miss a new go-oidc-middleware release

NewReleases is sending notifications on new releases.