-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The update of gocloak allows a better config of the server url as the /auth is not autoamtically appended
- Loading branch information
Showing
14 changed files
with
126 additions
and
4,680 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package keycloakservice | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/Nerzal/gocloak/v13" | ||
) | ||
|
||
type ConnectionConfig struct { | ||
ServerUrl string | ||
Realm string | ||
ClientId string | ||
ClientSecret string | ||
} | ||
|
||
type KeycloakService interface { | ||
// defin the same methods as gocloak.GoCloak (only LoginClient, GetClients, GetClientSecret are used) | ||
LoginClient(ctx context.Context, clientID string, clientSecret string, realm string) (*gocloak.JWT, error) | ||
GetClients(ctx context.Context, token string, realm string, params gocloak.GetClientsParams) ([]*gocloak.Client, error) | ||
GetClientSecret(ctx context.Context, token string, realm string, clientID string) (*gocloak.CredentialRepresentation, error) | ||
} | ||
type KeycloakServiceFactory interface { | ||
NewClient(ctx context.Context, connConfig ConnectionConfig) (KeycloakService, error) | ||
} |
Oops, something went wrong.