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.
Install and activate the miniOrange OAuth Client plugin on the plugins page of your WordPress dashboard.
Open plugin settings using the button on the left sidebar:
You will see a page where you choose an OAuth/OpenID Connect provider. Scroll down to choose Custom OpenID Connect App:
The Configure OpenID Connect tab will be shown:
Fill in the required fields as follows:
Redirect/Callback URL is populated with your website URL (this can be changed in the paid version of the plugin)
App Name should be Freja eID
ClientID and Client secret are unique identifiers of Relying Parties that you get from Freja eID when you integrate with our system
Scope field populate with: openid profile email
Authorize Endpoint values:
Authorize Endpoint token values:
After populating the required fields, you will see a new button 'Test Configuration'.
After testing and making sure that the configuration is correct, the following should open in a new window:
If you were successful, save your configuration.
When you click on the Attribute/Role Mapping tab, you will be able to see a new tab where you can map user attributes:
Â
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:
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:
Â
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; }