182
Views
7
Comments
[GoogleAPIToken] Object reference not set to an instance of an object
Question
googleapitoken
Web icon
Forge asset by Miguel João

Hi Team,


Not able get the token. Getting the error "Object reference not set to an instance of an object".


Regards,

Amreen Shaikh

UserImage.jpg
Jyotsna Deokar

Hi Outsystems community,

I am getting the same issue for one of my service accounts while it is working fine for another service account.

below is the error which I can see in the service center.

Object reference not set to an instance of an object.
at Org.BouncyCastle.Crypto.Signers.RsaDigestSigner.Init(Boolean forSigning, ICipherParameters parameters)
at OutSystems.NssGoogleAPIToken.CssGoogleAPIToken.GetRS256Signature(Byte[] ssContent, String ssPrivateKey)
at OutSystems.NssGoogleAPIToken.CssGoogleAPIToken.MssGetToken(RCClientRecord ssClient, Int32 ssTokenLifespan, String ssScope, RCTokenRecord& ssToken)
  at ssVMG_YO_DA.RssExtensionGoogleAPIToken.MssGetToken(HeContext heContext, IRecord inParamClient, Int32 inParamTokenLifespan, String inParamScope, IRecord& outParamToken)


Need quick help in understanding this 

Regards,

Jyotsna

2018-05-03 15-19-41
Miguel João
Staff

Hello,

What Platform version are you using with this component? Need to know which version I should test.

Thanks

UserImage.jpg
Jyotsna Deokar

Version 11.10.6

2018-05-03 15-19-41
Miguel João
Staff

Thanks.

That's the IDE version. I need the server version. Access the server with a Web Browser, and use the URL

https://<your-server-hostname-here>/ServiceCenter

Login, and check the version at the topright corner

Thanks

UserImage.jpg
Jyotsna Deokar
2018-05-03 15-19-41
Miguel João
Staff

Hello Jyotsna,

Yes, I was able to test it and it works as expected with that platform version. What I also found out is that the input parameter Client.PrivateKey in the GetToken action, needs to be set to a multiline string, and it doesn't support "\n" characters.

So, if you're inputting your private key  as a single line string like:

"-----BEGIN PRIVATE KEY-----\nMIIEvQ....\n-----END PRIVATE KEY-----\n"

That will generate the error message "Object reference not set to an instance of an object. "

In order to set the private key correctly, you'll need to set as a multiline code, by replacing the "\n" with actual new lines, like:

"-----BEGIN PRIVATE KEY-----

MIIEvQ....

-----END PRIVATE KEY-----"

Then it should work.

If you can't overcome the problem with this information, I ask you to provide a sample app with the input valures (test values) you're using to call the GetToken.

Thanks

Cheers


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.