Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.
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
10 changes: 9 additions & 1 deletion src/widget/formatSSO.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,12 @@ export const formatSSO = (url, ssoUserString) => {
}

return url.replace('{{SSO}}', '');
};
};

export const formatOAuth = (url, accessToken) => {
if (accessToken) {
return url.replace('{{SSO}}', encodeURIComponent(accessToken));
}

return url.replace('{{SSO}}', '');
};
13 changes: 11 additions & 2 deletions src/widget/widget.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const buildfire = require('buildfire');
const { formatSSO } = require('./formatSSO');
const { formatSSO, formatOAuth } = require('./formatSSO');

const viewOptions = {
POPUP: 'In app popup',
Expand Down Expand Up @@ -55,6 +55,15 @@ const render = (content) => {
content.url = formatSSO(content.url, JSON.stringify(result.SSO));
handleWindow(openWindow, displayIniFrame, displaySuccessMessage);
}
else{
if (result && result.oauthProfile && result.oauthProfile.accessToken) {
content.url = formatOAuth(content.url, result.oauthProfile.accessToken);
handleWindow(openWindow, displayIniFrame, displaySuccessMessage);
}
else{
handleWindow(openWindow, displayIniFrame, displaySuccessMessage);
}
}
});
} else { //this is all other URLs, i.e. no SSO.
handleWindow(openWindow, displayIniFrame, displaySuccessMessage);
Expand Down Expand Up @@ -101,7 +110,7 @@ const renderiFrame = (props) =>{
let container = props.isIOS ? scrollable : window.document.body;

container.appendChild((() => {

if (flags.isWeb) {
let modal = (document.querySelectorAll('div[id^="confirm"]') || [])[0];
if (modal) {
Expand Down