From 9e43e5928be30fb4a3f5e8c0b3c57fd65288bd6b Mon Sep 17 00:00:00 2001 From: Felix <23635466+its-felix@users.noreply.github.com> Date: Thu, 14 Nov 2024 00:17:19 +0100 Subject: [PATCH] feat: add discord login provider --- pom.xml | 2 +- src/main/resources/application-beta.yml | 7 +++++++ src/main/resources/application-prod.yml | 13 +++++++++++++ src/main/resources/application-staging.yml | 7 +++++++ src/main/resources/example.application-local.yml | 7 +++++++ 5 files changed, 35 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e9184d6..cc985a7 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.gw2auth oauth2-server - 1.89.0 + 1.90.0 jar diff --git a/src/main/resources/application-beta.yml b/src/main/resources/application-beta.yml index 1e68d83..df2d883 100644 --- a/src/main/resources/application-beta.yml +++ b/src/main/resources/application-beta.yml @@ -46,6 +46,13 @@ spring: client-secret: ${GOOGLE_CLIENT_SECRET} scope: "id" redirect-uri: "{baseUrl}/auth/oauth2/code/google" + discord: + provider: gw2auth + client-name: "Discord" + client-id: ${DISCORD_CLIENT_ID} + client-secret: ${DISCORD_CLIENT_SECRET} + scope: "id" + redirect-uri: "{baseUrl}/auth/oauth2/code/discord" provider: gw2auth: issuer-uri: "https://gw2auth.com" diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index 38fd363..b6f4a9f 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -46,6 +46,14 @@ spring: client-secret: ${GOOGLE_CLIENT_SECRET} scope: "openid" redirect-uri: "{baseUrl}/auth/oauth2/code/google" + discord: + provider: discord + client-name: "Discord" + client-id: ${DISCORD_CLIENT_ID} + client-secret: ${DISCORD_CLIENT_SECRET} + authorization-grant-type: "authorization_code" + scope: "identify" + redirect-uri: "{baseUrl}/auth/oauth2/code/discord" provider: cognito: issuer-uri: "https://cognito-idp.${AMZ_COGNITO_REGION}.amazonaws.com/${AMZ_COGNITO_POOL_ID}" @@ -54,6 +62,11 @@ spring: user-name-attribute: id google: user-name-attribute: sub + discord: + authorization-uri: "https://discord.com/oauth2/authorize" + token-uri: "https://discord.com/api/oauth2/token" + user-info-uri: "https://discord.com/api/users/@me" + user-name-attribute: id management: endpoints: diff --git a/src/main/resources/application-staging.yml b/src/main/resources/application-staging.yml index 6552b35..aa5d321 100644 --- a/src/main/resources/application-staging.yml +++ b/src/main/resources/application-staging.yml @@ -46,6 +46,13 @@ spring: client-secret: ${GOOGLE_CLIENT_SECRET} scope: "id" redirect-uri: "{baseUrl}/auth/oauth2/code/google" + discord: + provider: gw2auth + client-name: "Discord" + client-id: ${DISCORD_CLIENT_ID} + client-secret: ${DISCORD_CLIENT_SECRET} + scope: "id" + redirect-uri: "{baseUrl}/auth/oauth2/code/discord" provider: gw2auth: issuer-uri: "https://gw2auth.com" diff --git a/src/main/resources/example.application-local.yml b/src/main/resources/example.application-local.yml index 230c71f..736ff65 100755 --- a/src/main/resources/example.application-local.yml +++ b/src/main/resources/example.application-local.yml @@ -71,6 +71,13 @@ spring: client-secret: ${GW2AUTH_LOGIN_PROVIDER_CLIENT_SECRET} scope: "id" redirect-uri: "{baseUrl}/auth/oauth2/code/google" + discord: + provider: gw2auth + client-name: "Discord" + client-id: ${GW2AUTH_LOGIN_PROVIDER_CLIENT_ID} + client-secret: ${GW2AUTH_LOGIN_PROVIDER_CLIENT_SECRET} + scope: "id" + redirect-uri: "{baseUrl}/auth/oauth2/code/discord" provider: gw2auth: issuer-uri: "https://gw2auth.com"