-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
fosite_store.go
37 lines (33 loc) · 1.08 KB
/
fosite_store.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package internal
import (
"context"
"github.com/ory/hydra/v2/client"
"github.com/ory/hydra/v2/driver"
)
func AddFositeExamples(r driver.Registry) {
for _, c := range []client.Client{
{
ID: "my-client",
Secret: "foobar",
RedirectURIs: []string{"http://localhost:3846/callback"},
ResponseTypes: []string{"id_token", "code", "token"},
GrantTypes: []string{"implicit", "refresh_token", "authorization_code", "password", "client_credentials"},
Scope: "fosite,openid,photos,offline",
},
{
ID: "encoded:client",
Secret: "encoded&password",
RedirectURIs: []string{"http://localhost:3846/callback"},
ResponseTypes: []string{"id_token", "code", "token"},
GrantTypes: []string{"implicit", "refresh_token", "authorization_code", "password", "client_credentials"},
Scope: "fosite,openid,photos,offline",
},
} {
// #nosec G601
if err := r.ClientManager().CreateClient(context.Background(), &c); err != nil {
panic(err)
}
}
}