Please find below complete details for implementation of SAP-Gmail Integration.
Requirement : SAP- GMail Integration using OAuth2
Process : I created service account and followed below standard procedures defined in a GoogleAPI OAuth2 - Service Account blog.
https://developers.google.com/identity/protocols/oauth2/service-account
Issue : While hitting googleapi for Oauth 2 from SAP , data is pushed in raw format. Which gives error "java.security.SignatureException: Invalid signature for token". Please find below screenshot of error.
Google API OAuth error
Findings : Below are my findings while testing API in postman.
- Success of API :
If I am using Body -> x-www-form-urlencoded tab in postman then I am getting Access Token Successfully.
With below shown HTTP code build.
Postman Screenshot 1:
Postman Success
HTTP Build 1:
Http Build 1
- Failure of API in Raw format:
If I am using Body-> Raw tab in postman then I am getting error with below shown HTTP code build.
Postman Screenshot 2:
Postman error
Postman header 2
HTTP Build 2:
Http build 2
- If you can see above HTTP code build in both, then you can find that both HTTP code are similar still first mode is working and second mode (Raw format) not working.
RootCause : I found one issue while validating error that, when I am posting data with Raw format, then "+" is getting removed from JWToken signature somehow. which is highlighted in error screenshot.
This small bug is causing a trouble and not allowing to create a token.
So can you please help me out how to resolve this issue in Raw format as SAP supports Raw format for posting data.
Regards,
Karan
question from:
https://stackoverflow.com/questions/65951424/error-java-security-signatureexception-invalid-signature-for-token-while-test 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…