Add Secure Authentication to your WordPress Site in 15 Minutes

sabith pocker

Some guide for Okta Paid Account to configure with Wordpress

For each External Application that needs to be configured with Okta one Application needs to be created in the Okta Admin section. External Application can be Wordpress or any other application supporting Okta.

To add a Wordpress Application:

Login and move to Admin Dashboard
Select Applications from Navigation Menu
Click on “Add Application” Button
You will reach Add Application Page
Click on the “Create New App” button in the right top, you will get a popup as shown below. Select Platform as “Web” and Sign on method as “OpenID Connect”
You will see a screen to enter application related data.
Enter Application Name as any Name that describes your application like “Wordpress Website”.
Enter Login redirect URI as the login page URI of Wordpress/Application. Eg: https://mywordpresssitecom/wp-login.php
Enter Logout Redirect URI as URI to be redirected to after Logout.
Save the application.

Allow CORS for the Wordpress URI

Once the application is setup we should configure Okta to allow calls from the Wordpress Domain. To do the same:
Login to Okta as Admin and go to Admin Dashboard
Go to Security → API from the Navigation
Go to Trusted Origins Tab
Click on “Add Origin”
Enter any name that helps you to identify the URi
Enter URI of the main domain
Select CORS and Redirection
Click “Save”

To configure Wordpress with Okta

Install Okta Wordpress Plugin
Make sure that you have an Application configured for this Wordpress website in your Okta account and at least one Admin user is Assigned to this application.
Go to the Application page General tab in Okta and look for client ID and client Secret at the bottom.

Keep the following 3 credentials ready:
Okta Domain - https://myaccount.okta.com
ClientID - Copy from application page shown above.
Client Secret - Copy from application page shown above.
Go to wordpress installation and go to
wordpress/wp-content/plugins/okta-wordpress-sign-in-widget-master1/env.php
Open the file in text editor, enter details kept ready
Save the file / upload back to the server if edited in local.
Sign in to Wordpress as Administrator
Go to Plugins → Installed Plugins and Activate “Okta Sign-in Widget”.
Log out from Wordpress using Logout link at top right.
Go to https://mywordpresssite.com…
You should be able to see the Okta login page here.
Enter your Okta Email and password to login to Wordpress that is assigned to this app in Okta.
You can sign in to Wordpress using Okta now.