sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Provider hosted app errors if we create clientsecret using graph api

Open mustaqp opened this issue 3 years ago • 6 comments

[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 image


Document Details

⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

mustaqp avatar Jul 31 '23 22:07 mustaqp

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

ghost avatar Jul 31 '23 22:07 ghost

@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

qianghuang1 avatar Sep 06 '23 00:09 qianghuang1

@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.

mustaqp avatar Sep 06 '23 00:09 mustaqp

Following in case of an update here. Please see my comment on #9170 as well.

brett-src avatar Sep 06 '23 17:09 brett-src

Please refer to latest discussion in https://github.com/SharePoint/sp-dev-docs/issues/9170

qianghuang1 avatar Sep 08 '23 03:09 qianghuang1

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.

github-actions[bot] avatar May 03 '25 16:05 github-actions[bot]