Skip to content

kenakamu/line-login-sdk-csharp

Repository files navigation

LINE Login SDK for C#

This repository contains LINE Login SDK for C# and MVC Authentication Middleware (Full .NET) See Integrating LINE Login with your web app for LINE Login detail.

LINE Login SDK for C#

line-login-csharp contains source code for LINE Login. You can get it via NuGet. LineLogin.CSharp

Usage

Instantiate LINE Login Client

var client = new LineLoginClient(channelId, channelSecret, redirectUri, "State", Scope.Profile | Scope.OpenId);

Get Authorization URL

var authUri = client.GetAuthUri();

Get Token (AccessToken and JWT)

var code = Request.QueryString["code"];
var token = await client.GetToken(code);

LINE Login OWIN Middleware

LineLoginMiddleware contains source code for LINE Login OWIN Middleware. You can get it via NuGet. Owin.Security.Middleware.Line

Usage

Add following in ConfigureAuth method in Startup.Auth.cs. Also add necessary parameters in Web.config.

app.UseLineAuthentication(new LineAuthenticationOptions(
    channelId : ConfigurationManager.AppSettings["ChannelId"],
    channelSecret : ConfigurationManager.AppSettings["ChannelSecret"],
    redirectUri : ConfigurationManager.AppSettings["RedirectUri"],
    scope : Scope.OpenId | Scope.Profile
));

Samples

line-login-csharp-web contains an ASP.NET web application which uses LINE Login SDK.

line-login-csharp-mvc-owin contains a MVC application which uses LINE Login OWIN Middleware.

LICENSE

MIT

Reference

I refer to following references to get basic coding idea.

TerribleDev/OwinOAuthProviders
Understanding OWIN Forms authentication in MVC 5
Integrating LINE Login with your web app

About

LINE Login SDK for C# and MVC Authentication Middleware

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages