Overview
Implement ILinkedInAuthService and its concrete implementation that calls the LinkedIn OAuth 2.0 token refresh endpoint to exchange a refresh_token for a new access_token.
Depends on: #56
Tasks
public interface ILinkedInAuthService
{
Task<(string accessToken, string refreshToken)> RefreshTokenAsync(string refreshToken);
}
LinkedIn Endpoint Reference
POST https://www.linkedin.com/oauth/v2/accessToken
Content-Type: application/x-www-form-urlencoded
grant_type=refresh_token
&refresh_token=<token>
&client_id=<client_id>
&client_secret=<client_secret>
Acceptance Criteria
Notes
- LinkedIn may or may not return a new
refresh_token in the response — handle both cases gracefully (only update Key Vault if a new one is returned)
- OpenID Connect is already enabled on the LinkedIn Developer App ✅
References
Overview
Implement
ILinkedInAuthServiceand its concrete implementation that calls the LinkedIn OAuth 2.0 token refresh endpoint to exchange arefresh_tokenfor a newaccess_token.Depends on: #56
Tasks
src/Abstraction/ILinkedInAuthService.cs:src/Services/LinkedInAuthService.cs:https://www.linkedin.com/oauth/v2/accessTokengrant_type=refresh_token,refresh_token,client_id,client_secretLinkedInTokenResponse(accessToken, refreshToken, expiresIn)client_idandclient_secretviaIKeyVaultService(secrets:LinkedInClientId,LinkedInClientSecret)Program.csas TransientHttpClientandIKeyVaultServiceLinkedIn Endpoint Reference
Acceptance Criteria
access_tokenandrefresh_tokenon successNotes
refresh_tokenin the response — handle both cases gracefully (only update Key Vault if a new one is returned)References