diff --git a/pom.xml b/pom.xml
index 2b8e167..4afe31c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -137,5 +137,25 @@
1.15
compile
+
+
+ com.nimbusds
+ oauth2-oidc-sdk
+ 9.43.3
+ compile
+
+
+ com.nimbusds
+ nimbus-jose-jwt
+ 9.37.3
+ compile
+
+
+
+ org.apache.httpcomponents
+ httpclient
+ 4.5.14
+ compile
+
diff --git a/resources/config.yml b/resources/config.yml
index 43f74f5..c63ab02 100644
--- a/resources/config.yml
+++ b/resources/config.yml
@@ -56,6 +56,37 @@ log:
punishment: true
info: true
+# OAuth2 Configuration
+oauth2:
+ # OAuth2 provider settings
+ client_id: "your_client_id"
+ client_secret: "your_client_secret"
+
+ # OAuth2 endpoints
+ authorization_url: "https://your-provider.com/oauth2/authorize"
+ token_url: "https://your-provider.com/oauth2/token"
+ user_info_url: "https://your-provider.com/oauth2/userinfo"
+
+ # OAuth2 scopes to request
+ scopes: "openid profile groups"
+
+ # Redirect URI (should match your web server URL + /oauth2/callback)
+ redirect_uri: "http://localhost:8080/oauth2/callback"
+
+ # Group mapping from OAuth2 claims to local groups
+ # Maps OAuth2 group names to local group numbers
+ group_mapping:
+ "moderators": 1
+ "admins": 2
+ "superadmins": 3
+ "default": 1 # Default group for users not in any mapped group
+
+ # JWT claim field that contains user groups (e.g., "groups", "roles", "teams")
+ groups_claim: "groups"
+
+ # JWT claim field that contains username (e.g., "preferred_username", "sub", "email")
+ username_claim: "preferred_username"
+
# Permissions for each group
permissions:
group1: # moderator
diff --git a/resources/web/css/style.css b/resources/web/css/style.css
index a883019..5d53321 100644
--- a/resources/web/css/style.css
+++ b/resources/web/css/style.css
@@ -682,3 +682,31 @@ input[type="submit"]:hover, .btn:hover {
font-size:16px;
}
}
+
+/* OAuth2 Login Button Styles */
+.oauth2-btn {
+ display: inline-block;
+ padding: 12px 24px;
+ background-color: #4CAF50;
+ color: white;
+ text-decoration: none;
+ border-radius: 4px;
+ font-size: 16px;
+ font-weight: bold;
+ transition: background-color 0.3s;
+}
+
+.oauth2-btn:hover {
+ background-color: #45a049;
+ text-decoration: none;
+ color: white;
+}
+
+.oauth2-login {
+ text-align: center;
+}
+
+.oauth2-login p {
+ margin: 20px 0;
+ color: #666;
+}
\ No newline at end of file
diff --git a/resources/web/index.html b/resources/web/index.html
index d01bd6c..bbe4c24 100644
--- a/resources/web/index.html
+++ b/resources/web/index.html
@@ -57,11 +57,9 @@
BungeeWeb
@@ -109,37 +107,6 @@
-
-
-
@@ -147,16 +114,13 @@
@@ -168,7 +132,5 @@ BungeeWeb
-
-