You need to sign in to do that
Don't have an account?

Checking Trusted IP range through Apex
Hi,
Is there a way to access the trusted IP ranges through Apex and SOQL? I'm creating a visualforce application that checks if the user has specific Ip ranges set.
Thanks,
Andrew
Is there a way to access the trusted IP ranges through Apex and SOQL? I'm creating a visualforce application that checks if the user has specific Ip ranges set.
Thanks,
Andrew
You need to do 2 things:
1. Store your Id range in a custom setting object which has numeric fields like Start1__c, Start2__c, Start3__c, Start4__c which forms Id like (Start1__c.Start2__c.Start3__c.Start4__c) and same for End Ip. so that you can easily compare.
2. You can use this code snippet to get user IP and check it against above range: Hope this helps!
Note: ApexPages.currentPage() is null for Lightning components.