Creating OAuth2.0 JWT Certificate Credentials

Following are the steps for creating JWT certificate credentials for OAuth2.0 authentication:


This is the companion discussion topic for the documentation at https://documentation.sailpoint.com/connectors/microsoft/sharepoint_online/help/integrating_ms_sharepoint_online/adding_oauth_authentication.html

The openssl commands mentioned are “outdated”.
When running the command, you will get an error :

Error: Unsupported Algorithm When Extracting Public Certificate from PKCS#12 File

After looking into this error it seems adding “-legacy” at the end actually fixes this.
So the commands would look like :

openssl pkcs12 -in test1.pfx -nocerts -out sp.key -legacy

openssl pkcs12 -in test1.pfx -clcerts -nokeys -out sp.crt -legacy

openssl rsa -in sp.key -out rsasp.key

Also exporting the key and adding it to the source will result in an error :
Access token Generation Failed with exception [ InvalidConfigurationException ]
[ Error details ] Exception : java.lang.ClassCastException: class org.bouncycastle.asn1.pkcs.PrivateKeyInfo cannot be cast to class org.bouncycastle.openssl.PEMKeyPair (org.bouncycastle.asn1.pkcs.PrivateKeyInfo and org.bouncycastle.openssl.PEMKeyPair are in unnamed module of loader ‘app’)

Upon further investigation we had to convert the key using :

openssl rsa -in server.key -out server_new.key -traditional
1 Like