Thursday, February 21, 2019

SharePoint Provider hosted app: Invalid length for a Base-64 char array exception

This error means the string which we are trying to convert to base 64 encoding does not have enough length. More explanation is available at https://stackoverflow.com/questions/12962992/invalid-length-for-a-base-64-char-array-exception.

To  fix this error, append '=' character to the string till it becomes divisible by four.

In a SharePoint provider hosted app, this generally means the client secret (or secondary client secret) needs to be appended as above.

No comments:

Regex Email validation in c# dot net core

 Use this regex /^_?[a-zA-Z0-9]([a-zA-Z0-9]*[._+-])*[a-zA-Z0-9_]+@(?!-)[A-Za-z0-9-]{1,63}(?<!-)(\.(?!-)[A-Za-z0-9-]{1,63}(?<!-))*\.[A-...