-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: wrong redirect / error display on OIDC login
This also replace local mock for OIDC since old container did not work anymore. Fix #849
- Loading branch information
Showing
5 changed files
with
131 additions
and
56 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,99 @@ | |
version: '3.1' | ||
|
||
services: | ||
oidc-server-mock: | ||
container_name: oidc-server-mock | ||
image: ghcr.io/soluto/oidc-server-mock:latest | ||
ports: | ||
- '9001:8080' | ||
environment: | ||
ASPNETCORE_ENVIRONMENT: Development | ||
SERVER_OPTIONS_INLINE: | | ||
{ | ||
"AccessTokenJwtType": "JWT", | ||
"Discovery": { | ||
"ShowKeySet": true | ||
}, | ||
"Authentication": { | ||
"CookieSameSiteMode": "Lax", | ||
"CheckSessionCookieSameSiteMode": "Lax" | ||
} | ||
} | ||
LOGIN_OPTIONS_INLINE: | | ||
{ | ||
"AllowRememberLogin": false | ||
} | ||
LOGOUT_OPTIONS_INLINE: | | ||
{ | ||
"AutomaticRedirectAfterSignOut": true | ||
} | ||
API_SCOPES_INLINE: | | ||
- Name: some-app-scope-1 | ||
- Name: some-app-scope-2 | ||
API_RESOURCES_INLINE: | | ||
- Name: some-app | ||
Scopes: | ||
- some-app-scope-1 | ||
- some-app-scope-2 | ||
USERS_CONFIGURATION_INLINE: | | ||
[ | ||
{ | ||
"SubjectId":"1", | ||
"Username":"User1", | ||
"Password":"pwd", | ||
"Claims": [ | ||
{ | ||
"Type": "name", | ||
"Value": "Sam Tailor", | ||
"ValueType": "string" | ||
}, | ||
{ | ||
"Type": "email", | ||
"Value": "[email protected]", | ||
"ValueType": "string" | ||
}, | ||
{ | ||
"Type": "some-api-resource-claim", | ||
"Value": "Sam's Api Resource Custom Claim", | ||
"ValueType": "string" | ||
}, | ||
{ | ||
"Type": "some-api-scope-claim", | ||
"Value": "Sam's Api Scope Custom Claim", | ||
"ValueType": "string" | ||
}, | ||
{ | ||
"Type": "some-identity-resource-claim", | ||
"Value": "Sam's Identity Resource Custom Claim", | ||
"ValueType": "string" | ||
} | ||
] | ||
} | ||
] | ||
CLIENTS_CONFIGURATION_INLINE: | | ||
[ | ||
{ | ||
"ClientId": "foo", | ||
"ClientSecrets": ["bar"], | ||
"Description": "Client for implicit flow", | ||
"AllowedGrantTypes": ["authorization_code"], | ||
"RequirePkce": false, | ||
"AllowAccessTokensViaBrowser": true, | ||
"RedirectUris": ["http://localhost:3000/login"], | ||
"AllowedScopes": ["openid", "profile", "email"], | ||
"IdentityTokenLifetime": 3600, | ||
"AccessTokenLifetime": 3600, | ||
"AlwaysIncludeUserClaimsInIdToken": true | ||
} | ||
] | ||
ASPNET_SERVICES_OPTIONS_INLINE: | | ||
{ | ||
"ForwardedHeadersOptions": { | ||
"ForwardedHeaders" : "All" | ||
} | ||
} | ||
volumes: | ||
- .:/tmp/config:ro | ||
db: | ||
image: postgres | ||
restart: always | ||
|
@@ -12,12 +105,12 @@ services: | |
# - ./schema.sql:/docker-entrypoint-initdb.d/schema.sql | ||
ports: | ||
- 5432:5432 | ||
openid: | ||
image: qlik/simple-oidc-provider | ||
environment: | ||
REDIRECTS: http://localhost:3000/login | ||
ports: | ||
- 9001:9000 | ||
#openid: | ||
# image: qlik/simple-oidc-provider | ||
# environment: | ||
# REDIRECTS: http://localhost:3000/login | ||
# ports: | ||
# - 9001:9000 | ||
fake-smtp: | ||
image: reachfive/fake-smtp-server | ||
ports: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import test, { expect } from "@playwright/test"; | ||
|
||
test.describe("Home screen should", () => { | ||
test("allow tenant creation", async ({ page }) => { | ||
await page.goto("/login"); | ||
await page.getByRole("button", { name: "OpenId connect" }).click(); | ||
await expect(page).toHaveURL( | ||
new RegExp("^http://localhost:9001/Account/Login") | ||
); | ||
await page.getByLabel("Username").fill("User1"); | ||
await page.getByLabel("Password").fill("pwd"); | ||
await page.getByRole("button", { name: "Login" }).click(); | ||
await expect(page).toHaveURL("http://localhost:3000/home"); | ||
await expect( | ||
page.getByRole("button", { name: "Sam Tailor" }) | ||
).toBeVisible(); | ||
}); | ||
}); |
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