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

58 comments:

  1. Superb. I really enjoyed very much with this article here. Really it is an amazing article I had ever read. I hope it will help a lot for all. Thank you so much for this amazing posts and please keep update like this excellent article.thank you for sharing such a great blog with us. expecting for your.
    Digital Marketing Company in India

    ReplyDelete
  2. Thank you for sharing such a nice and interesting blog with us. Hope it might be much useful for us. keep on updating...!!
    seo company in india
    digital marketing company in india

    ReplyDelete
  3. 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
  4. 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
  5. 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
  6. 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
  7. 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
  8. 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
  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. 
    python course in pune
    python course in chennai
    python course in Bangalore

    ReplyDelete
  10. 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
  11. 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
  12. Inspiring writings and I greatly admired what you have to say , I hope you continue to provide new ideas for us all and greetings success always for you.
    Keep update more information..


    Selenium training in bangalore
    Selenium training in Chennai
    Selenium training in Bangalore
    Selenium training in Pune
    Selenium Online training
    Selenium interview questions and answers

    ReplyDelete
  13. Nice artilce on this.

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

    ReplyDelete
  14. 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
  15. 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.
    Selenium Training in Electronic City

    ReplyDelete
  16. I am looking for and I love to post a comment Python classes in punethat "The content of your post is awesome" Great work!

    ReplyDelete

  17. 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
  18. For IOT Training in Bangalore Visit:
    IOT TRAINING IN BANGALORE

    ReplyDelete
  19. Attend The Artificial Intelligence courses From ExcelR. Practical Artificial Intelligence courses Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Artificial Intelligence courses.
    ExcelR Artificial Intelligence courses

    ReplyDelete
  20. 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
  21. 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
  22. 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
  23. 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
  24. Thanks for your post! Through your pen I found the problem up interesting! I believe there are many other people who are interested in them just like me! Thanks your shared!... I hope you will continue to have similar posts to share with everyone! I believe a lot of people will be surprised to read this article! Best DevOps online training in hyderabad


    ReplyDelete
  25. Machine learning course is structured to impart machine learning skills using the two most popular programming languages Python and R. This course enables the student to perform Data Wrangling, Data Cleansing and Data Mining (Supervised and Unsupervised) on structured and unstructured data. Python and R can be used as statistical software to develop regression analysis algorithms and other statistical computations in machine learning. Apprehend different machine learning algorithms like Black Box techniques, Neural Networks and Support Vector Machines. The student can build prediction models with Amazon Machine Learning Services in the best machine learning course in Hyderabad. Present reports to management with Data Visualization software Tableau.
    For more info click the below link
    360digitmg machine-learning

    ReplyDelete
  26. Thanks for giving me the time to share such nice information. Thanks for sharing.
    Data Science Course

    ReplyDelete
  27. 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
  28. Awesome blog. I enjoyed reading your articles. This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work!
    360Digitmg pmp training in hyderabad

    ReplyDelete
  29. 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
  30. If you own a website SEO is the best way to grow your business in this modern era. We are a Digital marketing agency providing SEO Services in Chennai. Hiring an SEO expert will increase your chances of growing your business better and faster than your competitor. So, if you are looking for Best SEO Services in Chennai feel free to contact us.

    ReplyDelete
  31. 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
  32. This is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more ... good luck.

    Simple Linear Regression

    Correlation vs Covariance

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

    ReplyDelete
  34. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
    Correlation vs Covariance
    Simple linear regression
    data science interview questions

    ReplyDelete
  35. 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
  36. 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
  37. Attend The Machine Learning Course Bangalore From ExcelR. Practical Machine Learning course Bangalore Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Machine Learning course Bangalore.
    Machine Learning Course Bangalore

    ReplyDelete