diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2023-04-03 10:12:19 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-03 10:12:19 -0700 |
commit | 2d92fa2473b2317f01b904a8f1afd83e7884d7c8 (patch) | |
tree | 3ed8307268122fc23838f4c4ab97fb954c1c1370 /src/main/java/org/traccar/config/Keys.java | |
parent | 836fb2221dedae55c3f8457f35294b3753f095c8 (diff) | |
parent | d05049c4fcad15b014d4d7178f3b88de7c0c7a28 (diff) | |
download | trackermap-server-2d92fa2473b2317f01b904a8f1afd83e7884d7c8.tar.gz trackermap-server-2d92fa2473b2317f01b904a8f1afd83e7884d7c8.tar.bz2 trackermap-server-2d92fa2473b2317f01b904a8f1afd83e7884d7c8.zip |
Merge pull request #5057 from dan-r/implement-oidc
Implement SSO with OpenID Connect
Diffstat (limited to 'src/main/java/org/traccar/config/Keys.java')
-rw-r--r-- | src/main/java/org/traccar/config/Keys.java | 64 |
1 files changed, 63 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/config/Keys.java b/src/main/java/org/traccar/config/Keys.java index c207efb1e..707e9e815 100644 --- a/src/main/java/org/traccar/config/Keys.java +++ b/src/main/java/org/traccar/config/Keys.java @@ -611,6 +611,68 @@ public final class Keys { List.of(KeyType.CONFIG)); /** + * Force OpenID Connect authentication. When enabled, the Traccar login page will be skipped + * and users are redirected to the OpenID Connect provider. + */ + public static final ConfigKey<Boolean> OPENID_FORCE = new BooleanConfigKey( + "openid.force", + List.of(KeyType.CONFIG)); + + /** + * OpenID Connect Client ID. + * This is a unique ID assigned to each application you register with your identity provider. + * Required to enable SSO. + */ + public static final ConfigKey<String> OPENID_CLIENTID = new StringConfigKey( + "openid.clientId", + List.of(KeyType.CONFIG)); + + /** + * OpenID Connect Client Secret. + * This is a secret assigned to each application you register with your identity provider. + * Required to enable SSO. + */ + public static final ConfigKey<String> OPENID_CLIENTSECRET = new StringConfigKey( + "openid.clientSecret", + List.of(KeyType.CONFIG)); + + /** + * OpenID Connect Authorization URL. + * This can usually be found in the documentation of your identity provider or by using the well-known + * configuration endpoint, eg. https://auth.example.com//.well-known/openid-configuration + * Required to enable SSO. + */ + public static final ConfigKey<String> OPENID_AUTHURL = new StringConfigKey( + "openid.authUrl", + List.of(KeyType.CONFIG)); + /** + * OpenID Connect Token URL. + * This can be found in the same ways at openid.authUrl. + * Required to enable SSO. + */ + public static final ConfigKey<String> OPENID_TOKENURL = new StringConfigKey( + "openid.tokenUrl", + List.of(KeyType.CONFIG)); + + /** + * OpenID Connect User Info URL. + * This can be found in the same ways at openid.authUrl. + * Required to enable SSO. + */ + public static final ConfigKey<String> OPENID_USERINFOURL = new StringConfigKey( + "openid.userInfoUrl", + List.of(KeyType.CONFIG)); + + /** + * OpenID Connect group to grant admin access. + * Defaults to admins. + */ + public static final ConfigKey<String> OPENID_ADMINGROUP = new StringConfigKey( + "openid.adminGroup", + List.of(KeyType.CONFIG), + "admins"); + + /** * If no data is reported by a device for the given amount of time, status changes from online to unknown. Value is * in seconds. Default timeout is 10 minutes. */ @@ -1573,7 +1635,7 @@ public final class Keys { List.of(KeyType.CONFIG)); /** - * Public URL for the web app. Used for notification and report link. + * Public URL for the web app. Used for notification, report link and OpenID Connect. * If not provided, Traccar will attempt to get a URL from the server IP address, but it might be a local address. */ public static final ConfigKey<String> WEB_URL = new StringConfigKey( |