Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Boolean isTrustedIp = false;
- Map<String, String> sessionAttributes;
- try {
- sessionAttributes = Auth.SessionManagement.getCurrentSession();
- } catch(Exception e) {
- isTrustedIp = false;
- // TODO handle unexpected error...
- }
- String sourceIP = sessionAttributes.get('SourceIp');
- if(sourceIp != null) {
- isTrustedIp = Auth.SessionManagement.inOrgNetworkRange(sourceIP);
- }
- // TODO do something with isTrustedIp...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement