CCS REST API Error 400
search cancel

CCS REST API Error 400

book

Article ID: 228324

calendar_today

Updated On:

Products

Control Compliance Suite Standards Server Control Compliance Suite Control Compliance Suite Standards Module

Issue/Introduction

When trying to use the Control Compliance Suite REST API you see the following errors.

Our ServiceNow API is generating an Error 400

400 Bad Request

invalid_grant

In the Application Server log file you may find an entry similar to this:

2021-11-15 19:53:38.168,2021-11-15 12:53:38.168,#####,Error,AppServer.Server,AppserverService,9424,,70,FromBase64_Decode,,0,0,"Error while generating access token. : System.FormatException: Invalid length for a Base-64 char array or string.
   at System.Convert.FromBase64_Decode(Char* startInputPtr, Int32 inputLength, Byte* startDestPtr, Int32 destLength)
   at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)
   at System.Convert.FromBase64String(String s)
   at Appserver.Server.Providers.AuthorizationServerProvider.<GrantResourceOwnerCredentials>d__14.MoveNext()"

 

Environment

CCS 12.x

Cause

Due to issues with special characters CCS 12.5.2 and above was enhanced to use base64 encoded passwords with the REST API.

Resolution

Please provide a base64 encoded password for use with the REST API. 

UTF-8 encoding of the base64 password string is accepted by the API.

If you do not have a way to do this you may use the following website.

https://www.base64encode.org/