OpenID Connect - WordPress Integration Guide

Setting up miniOrange 

This document will guide you through the process of integrating your WordPress website with Freja's OpenID Connect.

For the purposes of this guide we are using the free version of miniOrange OAuth Client plugin for Wordpress.

  1. Install and activate the miniOrange OAuth Client plugin on the plugins page of your WordPress dashboard.

  2. Open plugin settings using the button on the left sidebar:

  1. You will see a page where you choose an OAuth/OpenID Connect provider. Scroll down to choose Custom OpenID Connect App:

  1. The Configure OpenID Connect tab will be shown:

  1. Fill in the required fields as follows:

  2. After populating the required fields, you will see a new button 'Test Configuration'.

  1. After testing and making sure that the configuration is correct, the following should open in a new window:

  1. If you were successful, save your configuration.

  2. When you click on the Attribute/Role Mapping tab, you will be able to see a new tab where you can map user attributes:

     

  3. For this purpose we have mapped the username with the email attribute, meaning that the user's email will be used as their username


Other Options

Adding the miniOrange widget to the widget area

You can add the miniOrange widget on the widget area you want, in Appearance/Widget page of the Wordpress dashboard.

Click on the dropdown icon on the widget and choose the widget area, click Add Widget to save it.

Redirection after login

If you would like to redirect your users after login there are also 2 options:

  1. Redirect after each login

    Go to the Login Settings tab in MiniOrange settings > Advanced Settings section > Custom Redirect after login URL.

    Enter the URL you wish your users to be redirected to there.

    Please see below:

     

  2. Redirect after registration (first login) to your service

    If you want your users to be redirected to a custom URL after registration only, you need to make changes in the functions.php file of your Wordpress website.

    Please refer to the example below, pay special attention to $custom_page_url

    add_action('user_register', 'miniorange_registration' , 10, 1); // Function Definition function miniorange_registration( $user_id ) { $custom_page_url = 'https://your-url-goes-here'; wp_redirect( $custom_page_url ); exit; }