LineAuthentication 2.0.0

dotnet add package LineAuthentication --version 2.0.0
NuGet\Install-Package LineAuthentication -Version 2.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LineAuthentication" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add LineAuthentication --version 2.0.0
#r "nuget: LineAuthentication, 2.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install LineAuthentication as a Cake Addin
#addin nuget:?package=LineAuthentication&version=2.0.0

// Install LineAuthentication as a Cake Tool
#tool nuget:?package=LineAuthentication&version=2.0.0

LineAuthentication for ASP.NET Core

LineAuthentication provides LINE authentication like Twitter, Facebook, and other external login. Supports LINE Profile+.

Support Platforms

  • .NET 6+

How to use

It is very easy to use, just call AddLine() which is an extension method of AuthenticationBuilder. This API style is same of other external login, so you never confuse.

services
    .AddAuthentication()
    .AddLine(options =>
    {
        options.ClientId = Configuration["Authentication:Line:ChannelId"];
        options.ClientSecret = Configuration["Authentication:Line:ChannelSecret"];
    });

To access the LINE Profile+, add an authorization scope and extract the data from the JSON payload.

services
    .AddAuthentication()
    .AddLine(options =>
    {
        // ...

        // Add authorization scopes
        options.Scope.Add("real_name");
        options.Scope.Add("gender");
        options.Scope.Add("birthdate");
        options.Scope.Add("address");
        options.Scope.Add("phone");
        options.Scope.Add("email");

        // Map JSON payload to claims
        options.ClaimActions.MapJsonKey(ClaimTypes.Email, "email");

        // Access entire JSON payload
        options.Events.OnCreatingTicket = context =>
        {
            var json = context.User.GetRawText();
            return Task.CompletedTask;
        };
    });

Installation

dotnet add package LineAuthentication

LINE login docs

License

This library is provided under Apache License 2.0.

Authors

Tsubasa Yoshino is software developer in Tokyo, Japan. Awarded Microsoft MVP (Azure) since October, 2016. He's the original owner of this project.

Takaaki Suzuki is software developer in Fukui, Japan. Awarded Microsoft MVP (C#) since July, 2012. He's a contributer who led the .NET Standard / .NET 5 and LINE Profile+ support.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.
  • net7.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.0 146 4/12/2024
2.0.0-preview1 75 3/27/2024
1.1.4 10,691 11/13/2021
1.1.2 313 11/11/2021
1.1.1 600 7/30/2021
1.1.0 325 7/30/2021
1.0.0 310 5/26/2021