/app-auth0-idprovider

Primary LanguageJavaApache License 2.0Apache-2.0

Auth0 ID Provider App for Enonic XP

Authenticate your users using Auth0 services. This ID Providers handles log-in, sign-up, reset password, single sign-on, validation rules, Gravatar profile retrieval. The interface is based on Auth0 Lock widget, configurable through the ID Provider App configuration.

Usage

Step 1: If you do not have one, create an account on https://auth0.com/

Step 3: Install the application

  1. In the admin tool "Applications" of your Enonic XP installation, click on "Install".
  2. Select the tab "Enonic Market", find "Auth0 ID Provider", and click on the link "Install".

Step 4: Create and configure the user store

  1. In the admin tool "Users", click on "New".

  2. Fill in the fields and, for the field "Applications", select the application "Auth0 ID Provider".

  3. Configure the ID Provider:

    • Client
      • Domain: Copy the field "Domain" from your Auth0 client settings.
      • Client ID: Copy the field "Client ID" from your Auth0 client settings.
      • Client secret: Copy the field "Client Secret" from your Auth0 client settings.
    • (Optional) Groups
      • Groups: Groups automatically associated to new users
    • (Optional) Widget Options
      • Display
        • Allowed connection: Connections displayed by the widget. Defaults to all enabled connections. Examples: Username-Password-Authentication, github
        • Display avatar: Whether or not the user avatar and display name is fetched from Gravatar and display in the widget header.
        • Language: Language of the widget.
        • Title: Title of the widget.
      • Theme
        • Labelled submit button: Whether or not the submit button should have a label. When unchecked, an icon will be shown instead.
        • Logo URL: Image URL that will be placed in the widget's header. Defaults to Auth0's logo
        • Primary color: Primary color of the widget. Defaults to #ea5323.
      • Social
        • Social button style: Size of the buttons for the social providers.
      • Database
        • Allow login: When unchecked, the widget won't display the login screen
        • Allow forgot password: When unchecked, the widget won't display the "Don't remember your password?" link
        • Allow signup: When unchecked, the widget won't display the signup screen
        • Initial screen: Name of the screen that will be shown when the widget is opened.
        • Login after sign up: Whether or not the user will be signed in after a successful sign up.
  4. Apply and save

Step 5: Configure the virtual host mapping

  1. Edit the configuration file "com.enonic.xp.web.vhost.cfg", and set the new user store to your virtual host. (See Virtual Host Configuration for more information).

    enabled=true
      
    mapping.localhost.host = localhost
    mapping.localhost.source = /
    mapping.localhost.target = /
    mapping.localhost.idProvider.system = default
    
    mapping.example.host = example.com
    mapping.example.source = /
    mapping.example.target = /portal/master/mysite
    mapping.example.idProvider.myidprovider = default

Step 6: Define the allowed callback URLs

  1. Go back to your Auth0 Client settings
  2. Define the "Allowed Origins (CORS)"
  3. Define the ID provider callback URL in the field "Allowed Callback URLs"
    • The ID provider is listening for callbacks on "/portal/[branch]/_/idprovider/[idprovider]"
    • If you have a virtual host mapping hiding "/portal/[branch]", like the example above, then use the virtual host mapping source + "_/idprovider/".
    • For the example above, the value would be: "https://example.com/_/idprovider/myidprovider"
  4. Define the field "Allowed Logout URLs"
    • If you use the Javascript function "portalLib.logout()" with redirection, please list the redirection URLs in the field "Allowed Logout URLs"
    • For the example above, the value could be: "https://example.com/"

Releases and Compatibility

App version Required XP version Download
1.0.0 6.8.0 Download
1.0.1 6.8.0 Download
2.0.0 6.8.0 Download
2.0.1 6.8.0 Download
2.0.2 6.8.0 Download
3.0.0 7.0.0 Download
3.0.1 7.7.4 Download

Building and deploying

Build this application from the command line. Go to the root of the project and enter:

./gradlew clean build

To deploy the app, set $XP_HOME environment variable and enter:

./gradlew deploy