This project provides an opens source StackExchange Authenticator plug-in for the Curity Identity Server. This allows an administrator to add functionality to Curity which will then enable end users to login using their StackOverflow, SuperUser, ServerFault or other StackExchange credentials. The app that integrates with Curity may also be configured to receive the StackExchange access token, allowing it to manage StackExchange resources.
- Curity Identity Server 7.0.2 and its system requirements
- Maven 3
- Java SDK 17 or later
The source is very easy to compile. To do so from a shell, issue this command: mvn package
.
To install this plug-in, either download a binary version available from the releases section of this project's GitHub repository or compile it from source (as described above). If you compiled the plug-in from source, the package will be placed in the target
subdirectory. The resulting JAR file or the one downloaded from GitHub needs to placed in the directory ${IDSVR_HOME}/usr/share/plugins/stackexchange
. (The name of the last directory, stackexchange
, which is the plug-in group, is arbitrary and can be anything.) After doing so, the plug-in will become available as soon as the node is restarted.
Note
The JAR file needs to be deployed to each run-time node and the admin node. For simple test deployments where the admin node is a run-time node, the JAR file only needs to be copied to one location.
For a more detailed explanation of installing plug-ins, refer to the Curity developer guide.
To create a new app in StackExchange, go to the app registration page. Enter a Name
and Application Website
. For the OAuth Domain
, use as specific of a domain as you can (e.g., login.example.com
rather than example.com
). Leave the Enable Client Side OAuth Flow
option unticked. Finally, click the Register
button. An example app is shown in the following figure:
Take note of the client ID, secret and app key. These will be needed when configuring Curity.
Once the app is registered, it will be provisioned and can be viewed from the list of Stack Apps. At this point, the configuration in StackExchange is done and an instance of the authenticator can be configured in Curity.
The easiest way to configure a new StackExchange authenticator is using the Curity admin UI. The configuration for this can be downloaded as XML or CLI commands later, so only the steps to do this in the GUI will be described.
Go to the
Authenticators
page of the authentication profile wherein the authenticator instance should be created.Click the
New Authenticator
button.Enter a name (e.g.,
stackexchange1
).For the type, pick the
StackExchange
option:On the next page, you can define all of the standard authenticator configuration options like any previous authenticator that should run, the resulting ACR, transformers that should executed, etc. At the bottom of the configuration page, the StackExchange-specific options can be found.
Note
The StackExchange-specific configuration is generated dynamically based on the configuration model defined in the Java interface.
Certain required and optional configuration settings may be provided. One of these is the
HTTP Client
setting. This is the HTTP client that will be used to communicate with the StackExchange OAuth server's token and user info endpoints. This will only be required if the calls to StackExchange are made through a forwarding proxy or there is an benign SSL Man-in-the-Middle that uses some untrusted SSL certificate. To define this, do the following:- click the
Facilities
button at the top-right of the screen. - Next to
HTTP
, clickNew
. - Enter some name (e.g.,
stackexchangeClient
). - Toggle on the
Use Truststore
orProxy
options as needed. When finished, clickApply
.
- click the
Back in the StackExchange authenticator instance that you started to define, select the new HTTP client from the dropdown if you created one; otherwise, leave this setting blank.
In the
Client ID
textfield, enter the client ID from the StackExchange app configuration. This is the auto-generated ID that was shown after register it. Also enter the matchingClient Secret
andApp Key
.If wish to request certain scopes from StackExchange during user login, toggle on the desired scopes (e.g.,
Write Access
).
Once all of these changes are made, they will be staged, but not committed (i.e., not running). To make them active, click the Commit
menu option in the Changes
menu. Optionally enter a comment in the Deploy Changes
dialogue and click OK
.
Once the configuration is committed and running, the authenticator can be used like any other.
This plugin and its associated documentation is listed under the Apache 2 license.
Please visit curity.io for more information about the Curity Identity Server.
Copyright (C) 2017 Curity AB.