go-oidc icon indicating copy to clipboard operation
go-oidc copied to clipboard

Added logout functionality through provider

Open dlouwers opened this issue 5 years ago • 8 comments

Replacement for #190 since I need to create more pull requests now

dlouwers avatar Dec 20 '19 09:12 dlouwers

Seems to be an issue with the Go 1,9 build. Unclear what since it is the same PR that passed but from a different branch: The command "go get -v -t github.com/coreos/go-oidc/..." failed and exited with 2 during .

dlouwers avatar Dec 20 '19 09:12 dlouwers

@dlouwers Hey any updates on this? We are working on a similar use case where we need a redirect to a logout URL.

SachinVarghese avatar Mar 02 '20 16:03 SachinVarghese

@dlouwers is there any update on this? It looks like the Go 1.9 error causing the build to fail is:

../../../gopkg.in/square/go-jose.v2/encoding.go:58:9: undefined: strings.Builder

I'm looking forward to use this feature :)

brocaar avatar Aug 04 '20 10:08 brocaar

@dlouwers is there any update on this? It looks like the Go 1.9 error causing the build to fail is:

../../../gopkg.in/square/go-jose.v2/encoding.go:58:9: undefined: strings.Builder

I'm looking forward to use this feature :)

You need to use Go 1.10+ as this was added with Go 1.10 https://stackoverflow.com/questions/48978414/golang-strings-builder-type-undefined

StiviiK avatar Aug 05 '20 08:08 StiviiK

Would re-running the tests be the solution (and resolve the merge conflict)? Looks like Travis CI config has been updated to Go 1.12 and Go 1.13 since the test failed: https://github.com/coreos/go-oidc/blob/v2/.travis.yml#L4.

brocaar avatar Aug 05 '20 14:08 brocaar

+1 for getting this in.

mitar avatar May 12 '22 20:05 mitar

For anyone else going around this, you can currently do something like:

	provider, err := oidc.NewProvider(ctx, issuer)
	if err != nil {
		return nil, err
	}

	var claims struct {
		EndSessionURL string `json:"end_session_endpoint"`
	}
	err = provider.Claims(&claims)
	if err != nil {
		return nil, err
	}
	// ... claims.EndSessionURL is now end session URL to use

You have to construct final URL yourself, but it gets you moving.

mitar avatar May 18 '22 19:05 mitar

Hello,

Any updates on this?

ABGEO avatar Jun 22 '23 15:06 ABGEO