Hello hampton123
Please look at the following steps to help you:
Token Acquisition: Customers can obtain a B2C token securely by following the steps outlined in the Azure Active Directory B2C documentation. The process involves creating a user flow to enable users to sign up and sign in to your application, and adding a web API application to your Azure AD B2C tenant. The HTTP request must include an access token, which is denoted as access_token
in the responses from Azure AD B2C.
For scenarios involving data extraction with Azure Data Factory, you can use the Managed Identity Authentication, which eliminates the necessity of generating the Access token. You will have to grab the identity of the system assigned ADF or create a user assigned identity, and add this identity to the resource that you are accessing.
Token Refresh for Data Extraction: Refresh tokens are used to acquire new ID tokens and access tokens in an OAuth 2.0 flow. They provide your application with long-term access to resources on behalf of users without requiring interaction with those users. Your application shouldn’t be written with the expectation that a refresh token will last for a specific period of time. The only way for your application to know if a refresh token is valid is to attempt to redeem it by making a token request to Azure AD B2C.
For continuous and uninterrupted data extraction processes, you can implement a mechanism to refresh the token automatically. One common practice is to use a refresh token to create a new set of access and refresh tokens after the access token expires, without asking users to re-enter their credentials. This approach improves security while maintaining a positive user experience.
Remember to follow the best practices and recommendations provided by Azure AD B2C for integrating it into your application environments. Also, ensure to strike the right balance between application usability and your organization’s acceptable level of risk.