{"id":205,"date":"2022-01-07T10:43:05","date_gmt":"2022-01-07T10:43:05","guid":{"rendered":"https:\/\/blog.citrus-lime.com\/crmc\/?p=205"},"modified":"2022-01-07T10:43:05","modified_gmt":"2022-01-07T10:43:05","slug":"how-to-avoid-your-session-has-expired-for-ifd-crm","status":"publish","type":"post","link":"https:\/\/blog.citrus-lime.com\/crmc\/how-to-avoid-your-session-has-expired-for-ifd-crm\/","title":{"rendered":"How to avoid \u2018Your session has expired\u2019 for IFD CRM"},"content":{"rendered":"\n<p>When working with an Internet Facing Deployment of Dynamics CRM &#8211; we can often receive the &#8216;Your session has expired, please log in again&#8217; message after a short period of working within the system.<\/p>\n\n\n\n<p>This can be frustrating for the end-user, as this message can appear after a period of inactivity or worse during the middle of working within CRM.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image_346F8188.png\"><img decoding=\"async\" src=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image_thumb_0D353853.png\" alt=\"image\" title=\"image\" \/><\/a><\/figure>\n\n\n\n<p>Thankfully this Session Timeout is a setting which we can configure as part of our IFD Setup for Dynamics CRM.<\/p>\n\n\n\n<p>To do this, we need to access our ADFS Server via a Remote Desktop Connection and then run Powershell.&nbsp; NOTE: this would typically the 64 bit version of Powershell, so not named (x86)<\/p>\n\n\n\n<p>Once we have Powershell open, we need to invoke the following commands:<\/p>\n\n\n\n<p><strong>Add-PSSnapin Microsoft.Adfs.PowerShell<\/strong><\/p>\n\n\n\n<p>Loads the ADFS Powershell commands, so we can access them<\/p>\n\n\n\n<p><strong>Get-ADFSRelyingPartyTrust -Name &#8220;relying_party&#8221;<\/strong><\/p>\n\n\n\n<p>Shows us a screen-dump of all the settings in our ADFS Rely Party Trust &#8211; which is the element of ADFS that is allowing Security Tokens to be passed from ADFS and into Dynamics CRM<\/p>\n\n\n\n<p><strong>Set-ADFSRelyingPartyTrust -Targetname &#8220;relying_party&#8221; -TokenLifetime 480<\/strong><\/p>\n\n\n\n<p>Amends the Timeout of the Security Token to 480 minutes (8 hours)<\/p>\n\n\n\n<p><strong>Get-ADFSRelyingPartyTrust -Name &#8220;relying_party&#8221;<\/strong><\/p>\n\n\n\n<p>View that screen-dump again, so we can see our setting amended<\/p>\n\n\n\n<p>The &#8220;relying_party&#8221; in this is the Name that we gave the ADFS Rely Party Trust when first setup in ADFS &#8211; this can be found in the ADFS 2.0 Management Console:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/s3.amazonaws.com\/cdn.freshdesk.com\/data\/helpdesk\/attachments\/production\/1022338152\/original\/UsePowerShellToModifyADFRelyingPartyProperties.png?1431862100\" alt=\"\" \/><\/figure>\n\n\n\n<p>Once done &#8211; we can then see the new value of our Token Lifetime setting &#8211; this will change from 0 to 480 once we have run the Set- command.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/s3.amazonaws.com\/cdn.freshdesk.com\/data\/helpdesk\/attachments\/production\/1022338169\/original\/SetADFSTokenLifetime_1.png?1431862168\" alt=\"\" \/><\/figure>\n\n\n\n<p>As this is a common task for IFD Deployments of CRM, there is a number of good articles on this process:<\/p>\n\n\n\n<p><a href=\"https:\/\/social.technet.microsoft.com\/wiki\/contents\/articles\/7681.setting-the-adfs-timeout-for-crm-2011-internet-facing-deployments-ifd.aspx\">https:\/\/social.technet.microsoft.com\/wiki\/contents\/articles\/7681.setting-the-adfs-timeout-for-crm-2011-internet-facing-deployments-ifd.aspx<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/www.interactivewebs.com\/blog\/index.php\/server-tips\/your-session-in-microsoft-dynamics-crm-is-about-to-expire-crm-2011-extend-session-time\/\">https:\/\/www.interactivewebs.com\/blog\/index.php\/server-tips\/your-session-in-microsoft-dynamics-crm-is-about-to-expire-crm-2011-extend-session-time\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When working with an Internet Facing Deployment of Dynamics CRM &#8211; we can often receive the &#8216;Your session has expired, please log in again&#8217; message after a short period of working within the system. This can be frustrating for the end-user, as this message can appear after a period of inactivity or worse during the<\/p>\n","protected":false},"author":43,"featured_media":40,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_price":"","_stock":"","_tribe_ticket_header":"","_tribe_default_ticket_provider":"","_tribe_ticket_capacity":"0","_ticket_start_date":"","_ticket_end_date":"","_tribe_ticket_show_description":"","_tribe_ticket_show_not_going":false,"_tribe_ticket_use_global_stock":"","_tribe_ticket_global_stock_level":"","_global_stock_mode":"","_global_stock_cap":"","_tribe_rsvp_for_event":"","_tribe_ticket_going_count":"","_tribe_ticket_not_going_count":"","_tribe_tickets_list":"[]","_tribe_ticket_has_attendee_info_fields":false,"footnotes":""},"categories":[3],"tags":[],"class_list":{"0":"post-205","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-crm"},"featured_image_src":"https:\/\/blog.citrus-lime.com\/crmc\/wp-content\/uploads\/sites\/30\/2021\/11\/Dynamics-365-Consultancy-1.jpg","author_info":{"display_name":"jadesmith","author_link":"https:\/\/blog.citrus-lime.com\/crmc\/author\/jadesmith\/"},"_links":{"self":[{"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/posts\/205","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/users\/43"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/comments?post=205"}],"version-history":[{"count":1,"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/posts\/205\/revisions"}],"predecessor-version":[{"id":206,"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/posts\/205\/revisions\/206"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/media\/40"}],"wp:attachment":[{"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/media?parent=205"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/categories?post=205"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/tags?post=205"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}