Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM golang:1.21.3-alpine3.18 as go-builder
FROM docker.io/golang:1.24.2-alpine3.21 AS go-builder

WORKDIR /authorizer
COPY server server
COPY Makefile .
Expand All @@ -11,7 +12,7 @@ RUN apk add build-base &&\
make clean && make && \
chmod 777 build/server

FROM node:20-alpine3.18 as node-builder
FROM node:alpine AS node-builder
WORKDIR /authorizer
COPY app app
COPY dashboard dashboard
Expand All @@ -20,7 +21,7 @@ RUN apk add build-base &&\
make build-app && \
make build-dashboard

FROM alpine:3.18
FROM alpine:3.21
RUN adduser -D -h /authorizer -u 1000 -k /dev/null authorizer
WORKDIR /authorizer
RUN mkdir app dashboard
Expand Down
5 changes: 4 additions & 1 deletion server/resolvers/validate_jwt_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ func ValidateJwtTokenResolver(ctx context.Context, params model.ValidateJWTToken
}
}

hostname := parsers.GetHost(gc)
hostname := gc.Request.Header.Get("X-Forwarded-Host")
if hostname == "" {
hostname = parsers.GetHost(gc)
}

// we cannot validate nonce in case of id_token as that token is not persisted in session store
if nonce != "" {
Expand Down
3 changes: 2 additions & 1 deletion server/token/jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package token

import (
"errors"
"fmt"

"github.com/golang-jwt/jwt"

Expand Down Expand Up @@ -156,7 +157,7 @@ func ValidateJWTTokenWithoutNonce(claims jwt.MapClaims, hostname, subject string
}

if claims["iss"] != hostname {
return false, errors.New("invalid issuer")
return false, fmt.Errorf("invalid issuer iss[%s] != hostname[%s]", claims["iss"], hostname)
}

if claims["sub"] != subject {
Expand Down