Provider hosted app errors if we create clientsecret using graph api
[Enter feedback here]
If we create new ClientSecret using this way using Graph API and use it in ACS apps, we get error in tokenhelper.cs saying "The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters." Is this correct way to generate secret or we should use Azure AD Powershell or MSO powershell
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: 3d9d8235-c495-a7a3-a4a6-0d073db41d1d
- Version Independent ID: bdd22da6-06c6-569d-fccf-fd55baa3cef8
- Content: Replace an expiring client secret in a SharePoint Add-in
- Content Source: docs/sp-add-ins/replace-an-expiring-client-secret-in-a-sharepoint-add-in.md
- Product: sharepoint
- GitHub Login: @VesaJuvonen
- Microsoft Alias: vesaj
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
@mustaqp the new client secret wasn't in base64 format, you need to manually encode it by any library to use it in old way. Or you can change your add-in code to let it don't parse from base 64. refer to https://github.com/SharePoint/sp-dev-docs/issues/9170
@qianghuang94 Thanks for the details. I realized that I need to manually encode it. It would have been better to mention it in the article. I tried encoding as well but ACS or PHA app does not work with secret generated via Graph API. The script given generates secret with only password key and no Symmetric keys. ACS app secret have 1 password key and 2 Symmetric keys. If you have a Provider hosted app, please test and see if PHA works via secret generated with this given script. I think script is missing generation of other 2 keys. 9170 also pointed same issue.
Following in case of an update here. Please see my comment on #9170 as well.
Please refer to latest discussion in https://github.com/SharePoint/sp-dev-docs/issues/9170
Thank you for taking the time to file an issue. We periodically archive older or inactive issues as part of our issue management process, which automatically closes them once they are archived.
If you’d like to understand more about why and how we handle archived (closed) issues, please see Our approach to closed issues.
We appreciate your contribution and if this is still an active issue with the latest SPFx versions, please do resubmit the details. We needed to perform a cleanup, so that we can start with a clean table with a new process. We apologize for the inconvenience this might cause.