Skip to content

Commit

Permalink
feat: add function to keycloak package to get authentication flows (#277
Browse files Browse the repository at this point in the history
)
  • Loading branch information
wadahiro authored May 6, 2020
1 parent 86b1369 commit a937eb1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions keycloak/authentication_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,21 @@ type AuthenticationFlow struct {
BuiltIn bool `json:"builtIn"`
}

func (keycloakClient *KeycloakClient) ListAuthenticationFlows(realmId string) ([]*AuthenticationFlow, error) {
var authenticationFlows []*AuthenticationFlow

err := keycloakClient.get(fmt.Sprintf("/realms/%s/authentication/flows", realmId), &authenticationFlows, nil)
if err != nil {
return nil, err
}

for _, authenticationFlow := range authenticationFlows {
authenticationFlow.RealmId = realmId
}

return authenticationFlows, nil
}

func (keycloakClient *KeycloakClient) NewAuthenticationFlow(authenticationFlow *AuthenticationFlow) error {
authenticationFlow.TopLevel = true
authenticationFlow.BuiltIn = false
Expand Down

0 comments on commit a937eb1

Please sign in to comment.