You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## type [ClientCredentials](<https://github.com/greenbone/opensight-golang-libraries/blob/main/pkg/auth/auth_client.go#L53-L56>)
27
+
28
+
ClientCredentials to authenticate via \`Client credentials grant\` flow. Ref: https://www.keycloak.org/docs/latest/server_admin/index.html#_client_credentials_grant
29
+
30
+
```go
31
+
typeClientCredentialsstruct {
32
+
ClientIDstring
33
+
ClientSecretstring
34
+
}
35
+
```
36
+
37
+
<aname="Clock"></a>
38
+
## type [Clock](<https://github.com/greenbone/opensight-golang-libraries/blob/main/pkg/auth/auth_client.go#L20-L22>)
39
+
40
+
41
+
42
+
```go
43
+
typeClockinterface {
44
+
Now() time.Time
45
+
}
46
+
```
47
+
48
+
<aname="Credentials"></a>
49
+
## type [Credentials](<https://github.com/greenbone/opensight-golang-libraries/blob/main/pkg/auth/auth_client.go#L47-L49>)
50
+
51
+
Credentials holds the required credentials and determines the used auth type.
52
+
53
+
```go
54
+
typeCredentialsinterface {
55
+
// contains filtered or unexported methods
56
+
}
57
+
```
58
+
21
59
<aname="KeycloakClient"></a>
22
-
## type [KeycloakClient](<https://github.com/greenbone/opensight-golang-libraries/blob/main/pkg/auth/auth_client.go#L42-L47>)
60
+
## type [KeycloakClient](<https://github.com/greenbone/opensight-golang-libraries/blob/main/pkg/auth/auth_client.go#L86-L94>)
23
61
24
62
KeycloakClient can be used to authenticate against a Keycloak server.
GetToken retrieves a valid access token. The token is cached and refreshed before expiry. The token is obtained by \`Resource owner password credentials grant\` flow. Ref: https://www.keycloak.org/docs/latest/server_admin/index.html#_oidc-auth-flows-direct
86
+
GetToken retrieves a valid access token. The token is cached and refreshed before expiry.
49
87
50
88
<a name="KeycloakConfig"></a>
51
-
## type [KeycloakConfig](<https://github.com/greenbone/opensight-golang-libraries/blob/main/pkg/auth/auth_client.go#L23-L29>)
89
+
## type [KeycloakConfig](<https://github.com/greenbone/opensight-golang-libraries/blob/main/pkg/auth/auth_client.go#L31-L34>)
52
90
53
91
KeycloakConfig holds the credentials and configuration details
54
92
55
93
```go
56
94
type KeycloakConfig struct {
57
-
ClientID string
58
-
Username string
59
-
Password string
60
95
AuthURL string
61
96
KeycloakRealm string
62
97
}
63
98
```
64
99
100
+
<aname="ResourceOwnerCredentials"></a>
101
+
## type [ResourceOwnerCredentials](<https://github.com/greenbone/opensight-golang-libraries/blob/main/pkg/auth/auth_client.go#L60-L64>)
102
+
103
+
ResourceOwnerCredentials to authenticate via \`Resource owner password credentials grant\` flow. Ref: https://www.keycloak.org/docs/latest/server_admin/index.html#_oidc-auth-flows-direct
104
+
105
+
```go
106
+
typeResourceOwnerCredentialsstruct {
107
+
ClientIDstring
108
+
Usernamestring
109
+
Passwordstring
110
+
}
111
+
```
112
+
65
113
Generated by [gomarkdoc](<https://github.com/princjef/gomarkdoc>)
0 commit comments