Monday, September 19, 2016

Invalid JWT token. Could not resolve issuer token.

For the second time in three years. I have had the pleasure of encounter a "Invalid JWT token. Could not resolve issuer token." Error. The error comes from a provider-hosted add-in which worked fine the day before. The last time I got the error, I ended up recreate my client ID and client secret both in SharePoint online and need to update my web.config. But this year I was keen on finding a solution! After some time to even understand the error message. I found this article "Replace an expiring client secret in a SharePoint Add-in" https://msdn.microsoft.com/en-us/library/office/dn726681.aspx. Article goes step-by-step how to update your client secret. I have updated the script, as I allready knew my add-in name.

#set the name of my add-in
$displayName = "governanceapp"
Connect-MsolService
$appentry = Get-MsolServicePrincipal -all  | ? { $_.DisplayName -eq $displayName}
$principalId = $appentry.AppPrincipalId
$bytes = New-Object Byte[] 32
$rand = [System.Security.Cryptography.RandomNumberGenerator]::Create()
$rand.GetBytes($bytes)
$rand.Dispose()
$newClientSecret = [System.Convert]::ToBase64String($bytes)
New-MsolServicePrincipalCredential -AppPrincipalId $principalId -Type Symmetric -Usage Sign -Value $newClientSecret
New-MsolServicePrincipalCredential -AppPrincipalId $principalId -Type Symmetric -Usage Verify -Value $newClientSecret
New-MsolServicePrincipalCredential -AppPrincipalId $principalId -Type Password -Usage Verify -Value $newClientSecret
#this go into the web.config
$newClientSecret

56 comments:

  1. This blog explains the details about changing the ways of doing that business. That is understand well and doing some different process. Provides he best output of others. Thanks for this blog.
    Digital Marketing Company in Chennai
    SEO Company in Chennai

    ReplyDelete
  2. This blog explains the details about changing the ways of doing that business. That is understand well and doing some different process. Provides he best output of others. Thanks for this blog.

    Mobile App Development Company in India

    ReplyDelete
  3. great article which conveyed a good information.awaiting for more updaates like this.
    SEO Company in India
    SEO Services in India
    SEO Companies in India
    SEO Company India
    SEO Services India

    ReplyDelete
  4. Thanks a lot for sharing this with all of us, I like it and we can communicate. Do you need buy app ratings and reviews. To boost app ranking and double app downloads now.

    ReplyDelete
  5. I believe there are many more pleasurable opportunities ahead for individuals that looked at your site.
    Aws Training in Chennai
    Advanced Aws Training in Chennai

    ReplyDelete
  6. This blog is the general information for the feature. You got a good work for these blog.We have a developing our creative content of this mind.Thank you for this blog. This for very interesting and useful.
    Java training in Bangalore | Java training in Kalyan nagar

    Java training in Bangalore | Java training in Kalyan nagar

    Java training in Bangalore | Java training in Jaya nagar



    ReplyDelete
  7. Thanks for splitting your comprehension with us. It’s really useful to me & I hope it helps the people who in need of this vital information. 
    python course in pune
    python course in chennai
    python course in Bangalore

    ReplyDelete
  8. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
    Best Devops training in sholinganallur
    Devops training in velachery
    Devops training in annanagar
    Devops training in tambaram

    ReplyDelete
  9. Thanks for splitting your comprehension with us. It’s really useful to me & I hope it helps the people who in need of this vital information. 

    angularjs Training in chennai

    angularjs Training in chennai

    angularjs-Training in tambaram

    angularjs-Training in sholinganallur

    angularjs-Training in velachery

    ReplyDelete
  10. Nice artilce on this.

    Thanks for sharing.
    http://trickycoder.com SharePoint Site

    ReplyDelete
  11. Attend The Python training in bangalore From ExcelR. Practical Python training in bangalore Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Python training in bangalore.
    python training in bangalore

    ReplyDelete

  12. Easily, the article is actually the best topic on this registry related issue. I fit in with your Python classes in pune conclusions and will eagerly look forward to your next updates.

    ReplyDelete
  13. I am happy for sharing on this blog its awesome blog I really impressed. thanks for sharing.

    Upgrade your career Learn Data Warehousing Training in Bangalore from industry experts get Complete hands-on Training, Interview preparation, and Job Assistance at Softgen Infotech.

    ReplyDelete
  14. And indeed, I’m just always astounded concerning the remarkable things served by you. Some four facts on this page are undeniably the most effective I’ve had.
    Digital Marketing Training in Chennai

    ReplyDelete
  15. I am impressed by the information that you have on this blog. It shows how well you understand this subject.

    data science course in malaysia
    best tableau training
    data analytics course malaysia
    360DigiTMG

    ReplyDelete
  16. Enjoyed reading this article throughout.Nice post! Digital Marketing is the trendy course right now and is going to be in
    a great demand in near future as jobs for this domain will be sky rocketted.To be on par with the current trend we have to
    gain complete knowledge about the subject. For the complete course online
    360Digitmg Digital Marketing Course

    ReplyDelete
  17. Hey, thanks for this great article I really like this post and I love your blog and also Check IOT training in hyderabad at 360DIGITMG.
    360Digitmg IOT training in hyderabad

    ReplyDelete
  18. Attend The Machine Learning Courses in Bangalore From ExcelR. Practical Machine Learning courses in Bangalore Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Machine Learning courses in Bangalore.
    Machine Learning courses in Bangalore

    ReplyDelete
  19. Really nice and interesting post. I was looking for this kind of information and enjoyed reading this one. Keep posting. Thanks for sharing.

    ai course in delhi

    ReplyDelete
  20. I think it could be more general if you get a football sports activitydata science course

    ReplyDelete
  21. Yeah, this article is actually one of the very best in articles literature. I am an ancient reader of 'Articles' and often I read new articles if I find them interesting. And this one I consider to be pretty interesting and should go into my set. Very strong labour!360DigiTMG data science course in malaysia

    ReplyDelete
  22. Effectively, the article is really the best point on this library related issue. I fit in with your decisions and will excitedly anticipate your next updates.artificial intelligence course in noida

    ReplyDelete
  23. Thanks for the information about Blogspot very informative for everyone
    data science course gurgaon

    ReplyDelete
  24. Honestly speaking this blog is absolutely amazing in learning the subject that is building up the knowledge of every individual and enlarging to develop the skills which can be applied in to practical one. Finally, thanking the blogger to launch more further too.

    Data Analytics online course

    ReplyDelete
  25. I need to thank you for this particularly fantastic article. I definitely really liked every part of it.Educational Institute in Visakhapatnam.

    ReplyDelete
  26. Thanks for Sharing this Valuable Information with us: this is very useful for me. Keep it Up.
    data science certification

    ReplyDelete
  27. Thanks For your post. This is rally helpful for Data science for beginner.
    machine learning course aurangabad

    ReplyDelete
  28. Nice blog, very informative content.Thanks for sharing, waiting for the next update…
    Features of Java Programming Language
    Features of Java

    ReplyDelete
  29. I want to leave a little comment to support and wish you the best of luck.we wish you the best of luck in all your blogging enedevors.
    business analytics courses

    ReplyDelete
  30. Impressive blog to be honest definitely this post will inspire many more upcoming aspirants. Eventually, this makes the participants to experience and innovate themselves through knowledge wise by visiting this kind of a blog. Once again excellent job keep inspiring with your cool stuff.

    Data Science Training in Bhilai

    ReplyDelete
  31. Extremely overall quite fascinating post. I was searching for this sort of data and delighted in perusing this one. Continue posting. A debt of gratitude is in order for sharing.data scientist course in bhubaneswar

    ReplyDelete
  32. I feel very grateful that I read this. It is very helpful and very informative and I really learned a lot from it.
    cyber security certification malaysia

    ReplyDelete
  33. I want to leave a little comment to support and wish you the best of luck.we wish you the best of luck in all your blogging enedevors
    data science training in delhi

    ReplyDelete
  34. I want to leave a little comment to support and wish you the best of luck.we wish you the best of luck in all your blogging enedevors
    business analytics course in varanasi

    ReplyDelete
  35. I want to leave a little comment to support and wish you the best of luck.we wish you the best of luck in all your blogging enedevors
    data scientist course in trivandrum

    ReplyDelete