Skip to content

Commit

Permalink
feat(oidc_auth): Add backend support for OIDC Auth
Browse files Browse the repository at this point in the history
Signed-off-by: deo002 <[email protected]>
  • Loading branch information
deo002 committed Dec 19, 2024
1 parent d3058ba commit 4f620b4
Show file tree
Hide file tree
Showing 22 changed files with 1,722 additions and 200 deletions.
29 changes: 28 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,31 @@
TOKEN_HOUR_LIFESPAN=24
# Secret key to sign tokens (openssl rand -hex 32)
API_SECRET=some-random-string
READ_API_AUTHENTICATION_ENABLED=false
READ_API_AUTHENTICATION_ENABLED=false

PORT=8080

# OIDC Provider (To be set if OIDC Authentication support required)
# The URL for retrieving keys for Token Parsing
JWKS_URI=https://provider/keys

# The field in ID Token that is to be used as username
OIDC_USERNAME_KEY=employee_id

# The field in ID Token that is to be used as email
OIDC_EMAIL_KEY=mail

# The issuer url
OIDC_ISSUER=https://provider

# The field in ID Token that is used as display name
OIDC_DISPLAYNAME_KEY=display_name

# Some OIDC providers do not provide the "alg" header in their key set(ex. AzureAD)
# This env variable, if set, will be used for signing while verifying the JWT signature
# (Make sure it's same as the signing algorithm used by the provider)
# If not set, there will be multiple verify attempts done with all the algorithms in the
# family of algorithms mentioned in the "kty" field till a match is found
#
# For OIDC providers that provide the "alg" header in their key set, there is no need for this to be set
OIDC_SIGNING_ALG=RS256
4 changes: 2 additions & 2 deletions .github/workflows/api-swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.22'
check-latest: true
cache: true

Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.22'
check-latest: true
cache: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.22'
check-latest: true
cache: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.22'
check-latest: true
cache: true

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-FileCopyrightText: 2024 Kaushlendra Pratap <[email protected]>
# SPDX-License-Identifier: GPL-2.0-only
FROM golang:1.20 AS build
FROM golang:1.22 AS build

WORKDIR /LicenseDb

Expand Down
Loading

0 comments on commit 4f620b4

Please sign in to comment.