-
-
Save mubaidr/ae3576300869564d061b0aa944ab048b to your computer and use it in GitHub Desktop.
LinkedIn APIs for .NET
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void ConfigureAuth(IAppBuilder app) | |
{ | |
// ... | |
var linkedInOptions = new LinkedInAuthenticationOptions(); | |
linkedInOptions.ClientId = "Your LinkedIn API Key"; | |
linkedInOptions.ClientSecret = "Your LinkedIn Secret Key"; | |
linkedInOptions.Scope.Add("r_fullprofile"); | |
linkedInOptions.Provider = new LinkedInAuthenticationProvider() | |
{ | |
OnAuthenticated = async context => | |
{ | |
context.Identity.AddClaim(new System.Security.Claims.Claim("LinkedIn_AccessToken", context.AccessToken)); | |
} | |
}; | |
linkedInOptions.SignInAsAuthenticationType = DefaultAuthenticationTypes.ExternalCookie; | |
app.UseLinkedInAuthentication(linkedInOptions); | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment