web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / How to get login user(...
Power Pages
Answered

How to get login user(contact) 's Ip address?

(0) ShareShare
ReportReport
Posted on by 38

I need to save user's login time and  ip address when login successfully.

 

The problem is I can't get the ip address.

 

Anyone knows how to get the ip address via liquid or javascript or any other ways?

 

Categories:
I have the same question (0)
  • Verified answer
    Saud Ali Profile Picture
    812 Super User 2024 Season 1 on at

    Hi @wangac ,

     

    There is no direct way available to get IP address of logged in user.

     

    But there is a workaround that you can use that. You can call this free Api that will provide you logged in user IP address and few other details. Here is the URL: https://ipinfo.io/json.

     

    You can call this Api once user is successfully logged in and save this information either in Dataverse or Local Storage as you wish. You can first try pasting above URL in your browser and you can see IP and other details. 

     

    To call this Api via JS, here is an example to use:

     

    // Call Api to Get User's IP Address
    fetch('https://ipinfo.io/json')
     .then(response => response.json())
     .then(data => {
     // Pass the IP address to Liquid template or save in Dataverse/Local Storage
     var userIp = data.ip;
     })
     .catch(error => console.error('Error fetching IP address:', error));
    

     

    Hope this helps you. Feel free to share if you have any questions. 

     

    Thanks,

    Saud

     

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

     

     

  • wangac Profile Picture
    38 on at

    @saudali_25 Thanks very much.

    Your reply is very helpful.

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Pages

#1
Suriyanarayanan V Profile Picture

Suriyanarayanan V 11

#2
Fubar Profile Picture

Fubar 6 Super User 2026 Season 1

#3
oliver.rodrigues Profile Picture

oliver.rodrigues 5 Most Valuable Professional

Last 30 days Overall leaderboard