Last active
August 21, 2018 09:04
-
-
Save hastef88/116d46ec66c2957a9820624c344e5d8f to your computer and use it in GitHub Desktop.
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 onInitialRequest(context) { | |
executeStep(1, { | |
onSuccess: function (context) { | |
Log.info('First Authentication success'); | |
var subject = context.steps[1].subject; | |
var requestIP = "" + context.request.headers["x-forwarded-for"]; | |
var knownIPs = "" + subject.localClaims['http://wso2.org/claims/identity/trustedips']; | |
Log.info('Request IP: ' + requestIP); | |
Log.info('KnownIPs: ' + knownIPs); | |
if (knownIPs != requestIP) { | |
executeStep(2); | |
} | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment