Skip to content

Commit 4ffff01

Browse files
authored
Merge pull request #3 from Creoox/develop
Bugfix: Implicit Flow
2 parents 3ad3119 + 2bb2895 commit 4ffff01

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@ At the current state of implementation, two authentication flows are possible:
3131

3232
Currently tested providers:
3333

34-
| Provideer | Version | Result | Comment |
34+
| Provider | Version | Result | Comment |
3535
| ------------------------------------------------------ | ------- | ------ | ------------- |
3636
| [Keycloak](https://www.keycloak.org/) | 17.1 || |
3737
| [SAP Commerce](https://help.sap.com/docs/SAP_COMMERCE) | ? || Running tests |
3838
| Google | ? | ➡️ | Planned |
39+
| GitHub | ? | ➡️ | Planned |
3940

4041
<br/>
4142

@@ -44,6 +45,7 @@ Currently tested providers:
4445
## Prerequisites
4546

4647
1. Prepared traefik-based infrastructure
48+
2. [OPTIONAL] [ModHeader](https://modheader.com/) to include authorization header in browser request
4749

4850
## Variables
4951

@@ -103,7 +105,6 @@ traefik:
103105
labels:
104106
- "traefik.enable=true"
105107
- "traefik.http.middlewares.traefik-https-redirect.redirectscheme.scheme=https"
106-
# - "traefik.http.middlewares.traefik-auth.basicauth.users=dummy:$$apr1$$iHNcpXTy$$cSNZ9EJt3fChWLn3s.v2L1"
107108

108109
- "traefik.http.routers.traefik.entrypoints=web"
109110
- "traefik.http.routers.traefik.rule=Host(`localhost`)"
@@ -114,7 +115,6 @@ traefik:
114115
- "traefik.http.routers.traefik-secure.tls=true"
115116
- "traefik.http.routers.traefik-secure.tls.certresolver=hypercpq"
116117
- "traefik.http.routers.traefik-secure.service=api@internal"
117-
# - "traefik.http.routers.traefik-secure.middlewares=traefik-auth"
118118
- "traefik.http.routers.traefik-secure.middlewares=traefik-forward-auth"
119119

120120
# https://doc.traefik.io/traefik/providers/docker/#docker-api-access
@@ -130,7 +130,7 @@ traefik:
130130
- cx-example-net
131131

132132
traefik-forward-auth:
133-
image: creoox/cx-traefik-forward-auth:1.0.0
133+
image: creoox/cx-traefik-forward-auth:1.0.1
134134
container_name: cx-example-traefik-forward-auth
135135
env_file:
136136
- ./cx-traefik-forward-auth.env

app/.env.example

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Application settings
22
APP_NAME=cx-traefik-forward-auth
3-
APP_VERSION=1.0.0
3+
APP_VERSION=1.0.1
44
APP_PORT=4181
55

66
## Environment settings

app/src/services/auth.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ const JWT_STRICT_AUDIENCE = ["true", "True", "1"].includes(
2525
* - Authorization Code Flow (default)
2626
* - Implicit Flow
2727
*
28-
* @param headers containing information with original request.
28+
* @param headers containing information with original request
29+
* @param [loginAuthFlow=LOGIN_AUTH_FLOW] optional parameter to set auth flow
2930
* @returns authorization url
3031
* @todo add Hybrid Flow
3132
*/
@@ -53,7 +54,6 @@ export const genAuthorizationUrl = (
5354
authorizationUrl = getOidcClient().authorizationUrl({
5455
scope: LOGIN_SCOPE,
5556
nonce: nonce,
56-
response_mode: "form_post",
5757
state: random_state,
5858
});
5959
} else {

app/src/states/clients.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const initOidcClient = async (): Promise<void> => {
1616
if (LOGIN_AUTH_FLOW === "id_token") {
1717
oidcClient = new issuer.Client({
1818
client_id: process.env.OIDC_CLIENT_ID as string,
19-
redirect_uris: [`${process.env.HOST_URI}/_oauth`],
19+
redirect_uris: [`${process.env.HOST_URI}${AUTH_ENDPOINT}`],
2020
response_types: [LOGIN_AUTH_FLOW],
2121
});
2222
} else {
@@ -25,7 +25,7 @@ export const initOidcClient = async (): Promise<void> => {
2525
client_secret: process.env.OIDC_CLIENT_SECRET
2626
? process.env.OIDC_CLIENT_SECRET
2727
: undefined,
28-
redirect_uris: [`${process.env.HOST_URI}/_oauth`],
28+
redirect_uris: [`${process.env.HOST_URI}${AUTH_ENDPOINT}`],
2929
response_types: [LOGIN_AUTH_FLOW],
3030
token_endpoint_auth_method: process.env.OIDC_CLIENT_SECRET
3131
? "client_secret_post"

0 commit comments

Comments
 (0)