In previous posts, we discussed working with various OAuth 2.0 grant types in SSIS by utilizing our OAuth Token Generator (offered in our SSIS Productivity Pack).
- How to Work with RESTful Endpoints in your SSIS ETL Process
- How to Work with Different OAuth 2.0 Grants in SSIS
In this post, we delve into getting an OAuth 2.0 access token with a certificate in SSIS. This will be a step-by-step demonstration on how to generate the JSON Web Token (JWT) assertion and use that JWT assertion to get the OAuth2 access token. We will be using Microsoft Graph API as an example for this blog.
Prerequisites
- You need to register an Azure AD application and set the appropriate permission for the app.
- You need to register your certificate with Azure AD. Please refer to this link for more details.
Get Token in SSIS
Before we get started in generating the token in OAuth Token Generator, let’s first take a look at the Microsoft documentation of getting an access token with a certificate.
Documentation (Link) Endpoint: Parameters:
|
Once you have the Microsoft AAD app registered and configured, you should be able to get all the required information to put into the OAuth Token Generator as shown below:
Click Next to go to the next page and click the Edit Body to edit the Request Body to specify the additional parameters – client_assertion and client_assertion_type.
To create the client_assertion, we need to enable the “Client Assertion” option in the Edit Body page. Let’s have a look at how to format the assertion.
Documentation (Link) Parameters:
|
Based on the documentation, we configure the OAuth Token Generator as follows:
Note in the Certificate Thumbprint option, we specify the thumbprint of the public certificate that we have uploaded to the Microsoft AAD application. Please make sure you have installed the corresponding Private Key file on the machine where HTTP Connection Manager/OAuth Token Generator is used.
Once done with Edit Body, fill the Request Token URL and click the Get Tokens button to get access_token from the endpoint.
The OAuth Token Generator will ask you to save the token once the access_token is successfully retrieved.
Conclusion
In this blog, we went through the JWT assertion OAuth2 authentication with a certificate and demonstrated the process of working with an OAuth2 authentication workflow in SSIS by using OAuth Token Generator found in our SSIS Productivity Pack. We hope this can help you speed up your SSIS development when working with OAuth 2.0 authentication.