{"id":3227,"date":"2015-03-20T09:10:57","date_gmt":"2015-03-20T16:10:57","guid":{"rendered":"http:\/\/www.cloudidentity.com\/blog\/?p=3227"},"modified":"2015-03-20T09:10:57","modified_gmt":"2015-03-20T16:10:57","slug":"azure-ad-token-lifetime","status":"publish","type":"post","link":"https:\/\/www.cloudidentity.com\/blog\/2015\/03\/20\/azure-ad-token-lifetime\/","title":{"rendered":"Azure AD Token Lifetime"},"content":{"rendered":"<p>For how long are AAD-issued tokens valid? I have mentioned this in scattered posts, but this AM Danny reminded me of how frequent this Q really is \u2013 and as such, it deserves its own entry.<\/p>\n<p><strong><u>As of today<\/u><\/strong>, the rules are pretty simple:<\/p>\n<ul>\n<li>Access tokens last 1 hour<\/li>\n<li>Refresh tokens last for 14 days, but<\/li>\n<ul>\n<li>If you use a refresh token within those 14 days, you will receive a new one with a new validity window shifted forward of another 14 days. You can repeat this trick for up to 90 days of total validity, then you\u2019ll have to reauthenticate<\/li>\n<li>Refresh tokens can be invalidated at ANY time, for reasons independent from your app (e.g. user changes password). Hence you should NOT take a dependency on the above in your code \u2013 your logic should always assume that the refresh token can fail at any time<\/li>\n<li>Refresh tokens issues for guest MSA accounts last only 12 hours<\/li>\n<\/ul>\n<\/ul>\n<p>That\u2019s it, short and sweet <img decoding=\"async\" class=\"wlEmoticon wlEmoticon-smile\" style=\"border-top-style: none; border-bottom-style: none; border-right-style: none; border-left-style: none\" alt=\"Smile\" src=\"https:\/\/www.cloudidentity.com\/blog\/wp-content\/uploads\/2015\/03\/wlEmoticon-smile1.png\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>For how long are AAD-issued tokens valid? I have mentioned this in scattered posts, but this AM Danny reminded me of how frequent this Q really is \u2013 and as such, it deserves its own entry. As of today, the rules are pretty simple: Access tokens last 1 hour Refresh tokens last for&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3227","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/posts\/3227","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/comments?post=3227"}],"version-history":[{"count":1,"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/posts\/3227\/revisions"}],"predecessor-version":[{"id":3228,"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/posts\/3227\/revisions\/3228"}],"wp:attachment":[{"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/media?parent=3227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/categories?post=3227"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/tags?post=3227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}