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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to get current logged in user session id in javascript and how I can validate it?

(0) ShareShare
ReportReport
Posted on by

Hi,

Here is my situation, in my js web resource I need to call external web services hosted somewhere else to read/write data to external system. I want to have some kind of user authentication on these web services side so these web methods only serve valid CRM user client not everyone. My question is if there is a way to pass something like a CRM user session id to these external web services then these external web services can use CRM sdk to validate the session id(or so called token).

Thanks in advance,

Lan

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at
    RE: How to get current logged in user session id in javascript and how I can validate it?

    Hi Izhang, I'm facing the exact same challenge. Did you find a solution?

  • Community Member Profile Picture
    on at
    RE: How to get current logged in user session id in javascript and how I can validate it?

    Hi Maniraj.K.V,

    Thanks for your suggestion. But I think validating client via passing user id is very easy to hack and not secure enough. Does CRM provide something like getting current logged in user session id or token which has a time expired mechanism ? Also this session id can be validated via CRM SDK on server side. Is it possible? Any other ideas or solution?

    Thanks,

    Lan

  • Suggested answer
    ManirajKV Profile Picture
    1,477 on at
    RE: How to get current logged in user session id in javascript and how I can validate it?

    Hi,

    You can get the current user id and pass the user id to external system, verify the user belongs to crm or not.

    Hope this link may show some light for ur requirement.

    www.powerobjects.com/.../dynamics-crm-portal-authentication-methods

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Aric Levin - MVP Profile Picture

Aric Levin - MVP 2 Moderator

#2
MA-04060624-0 Profile Picture

MA-04060624-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans