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
/* | |
- Data made available by nodes that have already executed are available in the sharedState variable. | |
- The script should set outcome to either "true" or "false". | |
*/ | |
var userID = nodeState.get("_id"); | |
var user = openidm.read("managed/alpha_user/" + userID); | |
var compID = user.memberOfOrgIDs[0]; | |
var company = openidm.read("managed/alpha_organization/" + compID); | |
var checkDomainLib = require('checkDomainLib'); | |
var status = (checkDomainLib.checkDomain(company.domain,company.dnsToken,httpClient))?"active":"inactive"; |
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
var requestURL = "https://dns.google/resolve?type=16"; | |
var requestOptions = { | |
method: 'GET', | |
body: "", | |
headers:{ | |
"accept": "application/dns-message", | |
"Content-Type": "application/dns-json" | |
} | |
}; |
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
config = { | |
"message": {"en-GB": `Hi ${nodeState.get("username")}. Please add this token value to your dns ${nodeState.get('objectAttributes').get("dnsToken")}.`}, | |
"messageYes": {"en-GB": "Ok"}, | |
"messageNo": {"en-GB": "I'll do it later"}, | |
} |
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
if (object.domain){ | |
var condition = `/mail co "` + object.domain + `"`; | |
object.condition = condition; | |
} |
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
/* | |
- Data made available by nodes that have already executed are available in the sharedState variable. | |
- The script should set outcome to either "true" or "false". | |
*/ | |
function createToken() { | |
return 'xxxxxxxxxxxxxxxxxxxxxxxx'.replace(/[x]/g, function() { | |
var r = Math.trunc(Math.random()*16); | |
var v = r; | |
return v.toString(16); |
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
/* | |
* Copyright 2021 ForgeRock AS. All Rights Reserved | |
* Use of this code requires a commercial software license with ForgeRock AS. | |
* or with one of its affiliates. All use shall be exclusively subject | |
* to such license between the licensee and ForgeRock AS. | |
*/ | |
/* | |
* The script has these top level functions that could be executed during a SAML2 flow. | |
* - preSingleSignOn |
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
var myCustomer = 'YOUR CUSTOMER NAME AT WHISPEAK'; | |
var myApplication = 'with-asr/YOUR WHISPEAK APPLICATION ID'; | |
var token, text; | |
var result = sharedState.get("voiceRecordedBlob").slice("data:audio/wav;base64,".length); | |
var decodedString = java.lang.String(org.forgerock.util.encode.Base64.decode(result),"ISO-8859-1"); | |
var requestCheckVoice = new org.forgerock.http.protocol.Request(); |
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
var apiKey = 'YOUR WHISPEAK API KEY'; | |
var myCustomer = 'YOUR CUSTOMER NAME AT WHISPEAK'; | |
var myApplication = 'with-asr/YOUR WHISPEAK APPLICATION ID'; | |
function createScript(text) { | |
return String("\n\ | |
var div = document.createElement('div'); \n\ | |
div.id = 'voiceRecorder'; \n\ | |
div.innerHTML = '<div class=\"container\">' +\n\ | |
'<h2>Record your voice</h2>' + \n\ | |
'<span style=\"font-size:20px;\">Please read the text below to register:</span>' + \n\ |
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
var myCustomer = 'YOUR CUSTOMER NAME AT WHISPEAK'; | |
var myApplication = 'with-asr/YOU WHISPEAK APPLICATION ID'; | |
var id = idRepository.getAttribute(sharedState.get("_id"), "fr-attr-istr2").iterator().next(); | |
var token, text; | |
var result = sharedState.get("voiceRecordedBlob").slice("data:audio/wav;base64,".length); | |
var decodedString = java.lang.String(org.forgerock.util.encode.Base64.decode(result),"ISO-8859-1"); | |
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
var apiKey = 'YOUR WHISPEAK API KEY'; | |
var myCustomer = 'YOUR CUSTOMER NAME AT WHISPEAK'; | |
var myApplication = 'with-asr/YOUR WHISPEAK APPLICATION ID'; | |
function createScript(text) { | |
return String("\n\ | |
var div = document.createElement('div'); \n\ | |
div.id = 'voiceRecorder'; \n\ | |
div.innerHTML = '<div class=\"container\">' +\n\ | |
'<h2>Record your voice</h2>' + \n\ | |
'<span style=\"font-size:20px;\">Please read the text below:</span>' + \n\ |
NewerOlder