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

adding an option to add logout redirect URLs #442

Open
justmike1 opened this issue Aug 22, 2023 · 2 comments
Open

adding an option to add logout redirect URLs #442

justmike1 opened this issue Aug 22, 2023 · 2 comments

Comments

@justmike1
Copy link
Contributor

justmike1 commented Aug 22, 2023

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

I want to add to my client a logout redirect URL, like I do with

		clientClient := gocloak.Client{
			PublicClient:              gocloak.BoolP(true),
			RootURL:                   gocloak.StringP(clientServerURL),
			AdminURL:                  gocloak.StringP(clientServerURL),
			RedirectURIs:              &[]string{clientServerURL + "/*"},
			WebOrigins:                &[]string{clientServerURL},
			ClientID:                  gocloak.StringP(clientClientName),
			ImplicitFlowEnabled:       gocloak.BoolP(true),
			DirectAccessGrantsEnabled: gocloak.BoolP(true),
		}

Describe the solution you'd like
A clear and concise description of what you want to happen.

something like:

		clientClient := gocloak.Client{
		        ....
			RedirectURIs:              &[]string{clientServerURL + "/*"},
			LogoutRedirectURIs:  &[]string{clientServerURL + "/*"},
			....
		}

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

None.

Additional context
Add any other context or screenshots about the feature request here.

this box in client section:
image

@vlaborie
Copy link

Hi,

You can define logout redirect URIs with Client.Attributes, eg:

clientID := "exampleclient"
c := &gocloak.Client{
        ClientID: &clientID,
}
logoutURIs := []string{"/logout", "/example"}
attr := make(map[string]string)
attr["post.logout.redirect.uris"] = strings.Join(logoutURIs, "##")
c.Attributes = &attr

ps: multiple URIs need to be join with ## (double hashtag)

@vlaborie
Copy link

It's seems you can configure every attributes configurable by Keycloak admin UI like this, and even add custom one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants