Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. Boolean isTrustedIp = false;
  2.  
  3. Map<String, String> sessionAttributes;
  4. try {
  5. sessionAttributes = Auth.SessionManagement.getCurrentSession();
  6. } catch(Exception e) {
  7. isTrustedIp = false;
  8. // TODO handle unexpected error...
  9. }
  10.  
  11. String sourceIP = sessionAttributes.get('SourceIp');
  12. if(sourceIp != null) {
  13. isTrustedIp = Auth.SessionManagement.inOrgNetworkRange(sourceIP);
  14. }
  15.  
  16. // TODO do something with isTrustedIp...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement