mirror of
https://github.com/project-zot/zot.git
synced 2026-06-15 20:07:55 +08:00
feat(authn): add generic oidc and allow customizable name (#1691)
Rebased and squashed Signed-off-by: Damien Degois <damien@degois.info>
This commit is contained in:
@@ -50,7 +50,7 @@ function setup() {
|
||||
"auth": {
|
||||
"openid": {
|
||||
"providers": {
|
||||
"dex": {
|
||||
"oidc": {
|
||||
"issuer": "http://127.0.0.1:5556/dex",
|
||||
"clientid": "zot-client",
|
||||
"clientsecret": "ZXhhbXBsZS1hcHAtc2VjcmV0",
|
||||
@@ -103,9 +103,9 @@ function teardown() {
|
||||
}
|
||||
|
||||
dex_session () {
|
||||
STATE=$(curl -L -f -s http://localhost:8080/openid/auth/login?provider=dex | grep -m 1 -oP '(?<=state=)[^ ]*"' | cut -d \" -f1)
|
||||
STATE=$(curl -L -f -s http://localhost:8080/openid/auth/login?provider=oidc | grep -m 1 -oP '(?<=state=)[^ ]*"' | cut -d \" -f1)
|
||||
echo $STATE >&3
|
||||
curl -L -f -s "http://127.0.0.1:5556/dex/auth/mock?client_id=zot-client&redirect_uri=http%3A%2F%2F127.0.0.1%3A8080%2Fopenid%2Fauth%2Fcallback%2Fdex&response_type=code&scope=profile+email+groups+openid&state=$STATE"
|
||||
curl -L -f -s "http://127.0.0.1:5556/dex/auth/mock?client_id=zot-client&redirect_uri=http%3A%2F%2F127.0.0.1%3A8080%2Fopenid%2Fauth%2Fcallback%2Foidc&response_type=code&scope=profile+email+groups+openid&state=$STATE"
|
||||
}
|
||||
|
||||
@test "check dex is working" {
|
||||
|
||||
@@ -17,7 +17,7 @@ grpc:
|
||||
staticClients:
|
||||
- id: zot-client
|
||||
redirectURIs:
|
||||
- 'http://127.0.0.1:8080/openid/auth/callback/dex'
|
||||
- 'http://127.0.0.1:8080/openid/auth/callback/oidc'
|
||||
name: 'zot'
|
||||
secret: ZXhhbXBsZS1hcHAtc2VjcmV0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user