Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added content/assets/domain-whitelisting.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed content/assets/domain_whitelisting.png
Binary file not shown.
93 changes: 93 additions & 0 deletions content/howto/web-sso.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
---
title: Enable Web SSO
description: ""
summary: "A guide on how to implement web sso in any web application"
---

Single sign-on (SSO) is the authentication mechanism, which allows users to sign in to different software systems with a single digital identity. After signing into one application user is signed into another application automatically.


## Web SSO

Web SSO is a method of browser-based session management that utilizes browser storage mechanisms like sessionStorage, localStorage, cookies to maintain the user’s session across your applications.

## How does it work in LoginRadius?
A centralized domain managed by LoginRadius Auth Page ( IDX ) is utilized to perform the authentication. When requested, this centralized domain shares the session with authorized applications.

So that the users logged in to one application automatically logs into other applications, independent of technology, platform, or domain the user is using.

## Configuration

To use LoginRadius Web SSO, make sure the desired domains are whitelisted under Domain Whitelisting in the LoginRadius dashboard.
To add the application domain, Login to your LoginRadius Dashboard account, from the left navigation panel, click the Configuration and then navigate to the Domain Whitelisting section. Click the down arrow or anywhere within the section.

<div style="text-align:center">
<img src="../assets/domain-whitelisting.png" alt="auth_1" />
</div>

## Setting Up SSO Token
This section covers how you can manually set a LoginRadius access_token for SSO.

### Setting The SSO Token via Ajax Call

To manually set the access_token for SSO via AJAX, simply makes an AJAX call to the following endpoint: `https://<LoginRadius Site Name>.hub.loginradius.com/ssologin/setToken`

#### Query Parameters:

- **token**: Pass in the access_token that you desire to set for SSO.

- **apikey**: Your LoginRadius API Key

- **callback**: Your AJAX callback method.

Example of an AJAX Call function:

```javascript
$.ajax({
type: "GET",
url: "https://<your lr app name>.hub.loginradius.com/ssologin/setToken",
dataType: "json",
data: $.param({
token: token,
apikey: "your-API-key"
}),
xhrFields: {
withCredentials: true
},
success: function (response) {
console.log(response);
//write your code here after setting the token successfully
},
error: function (xhr, status, error) {
console.log(error);
//write your code here for error handling
}
});

```

### Setting the SSO Token via HTTPs Redirect

In Safari browsers, there is an additional security layer preventing cookies from being modified externally, which restricts the use of JSONP for this use case. As a solution, you can simply use an HTTPs redirect for your Safari customers.

Simply do a redirect to the following endpoint:

`https://<sitename>.hub.loginradius.com/ssologin/setSafariToken`

#### Query Parameters:

**token**: Pass in the access_token that you desire to set for SSO.

**apikey**: Your LoginRadius API Key

**callback**: The callback URL, where you would like the customer to be redirected.

Example of a redirect method:

```javascript
if(safari){ // This is for safari browser, you need to check if your user is using safari or not
window.location="https://<sitename>.hub.loginradius.com/ssologin/setSafariToken?token=<accesstoken>&apiKey=<apikey>&callback=<callbackURL>"
}else{
Ajax function provided previously
}
```
3 changes: 2 additions & 1 deletion gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ module.exports = {
"howto/email-smtp-config",
"howto/email-templates",
"howto/social-login",
"howto/authentication-theme",
"howto/web-sso",
"howto/work-with-sott",
"howto/authentication-theme",
"howto/user-management",
],
Concepts: ["concepts/idx-overview"],
Expand Down