Created
October 30, 2017 16:50
-
-
Save eballisty/532753bd1437723725a1d8bde6c5f930 to your computer and use it in GitHub Desktop.
Mura SSO
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onSiteRequestStart($) { | |
if (external_service_gives_successful_login_message) { | |
userBean = $.getBean('user').loadBy(username=oAuth.prsId, $.event('siteID')); | |
userBean.setUsername(oAuth.prsId); | |
userBean.setPassword(oAuth.prsId & 'RANDOMREALLYCOMPLICATEDSTRING'); | |
userBean.setFname(oAuth.firstName); | |
userBean.setLname(oAuth.lastName); | |
userBean.setEmail(oAuth.emailAddress); | |
userBean.save(); | |
// log the user in | |
$.event("username", oAuth.prsId); | |
$.event("password", oAuth.prsId & "RANDOMREALLYCOMPLICATEDSTRING"); | |
$.getBean('loginManager').login($.event().getAllValues(),''); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment