Byndyusoft.Net.YandexAuth
0.0.2
dotnet add package Byndyusoft.Net.YandexAuth --version 0.0.2
NuGet\Install-Package Byndyusoft.Net.YandexAuth -Version 0.0.2
<PackageReference Include="Byndyusoft.Net.YandexAuth" Version="0.0.2" />
paket add Byndyusoft.Net.YandexAuth --version 0.0.2
#r "nuget: Byndyusoft.Net.YandexAuth, 0.0.2"
// Install Byndyusoft.Net.YandexAuth as a Cake Addin #addin nuget:?package=Byndyusoft.Net.YandexAuth&version=0.0.2 // Install Byndyusoft.Net.YandexAuth as a Cake Tool #tool nuget:?package=Byndyusoft.Net.YandexAuth&version=0.0.2
Byndyusoft.Net.YandexAuth
The package contains an implementation for authentication and authorization with the Yandex ID service. The implemented service is capable of:
- Creating a redirection link for the user to authenticate with Yandex ID.
- Retrieving user authentication data based on the code from the service.
- Retrieving authentication data based on a refresh token.
- Retrieving user data from the Yandex ID system.
Installing
dotnet add package Byndyusoft.Net.YandexAuth
Usage
- To use this package, first add the Yandex ID service parameters to the configuration:
"YandexIdOptions": {
"ClientId": "<your client id>",
"ClientSecret": "<your client secret>"
}
More details on registering the application and obtaining these parameters can be found at the provided link.
- Register the service for working with Yandex ID in the ConfigureServices method:
// IServiceCollection
services.AddYandexAuthorization(Configuration);
- Retrieving service from DI.
public class MyClass
{
private readonly IYandexAuthService _yandexAuthService;
public MyClass(IYandexAuthService service)
{
_yandexAuthService = service;
}
}
- Generate a link for user authentication in the Yandex ID service (documentation): In this implementation, the "redirect_uri" and "state" fields are used to create the link.
var redirectLink = _yandexAuthService.GetYandexAuthLink("<your-application-page-link>", "optional parameters");
- Obtain user authentication data based on the code.
var authenticateDataResult = await _yandexAuthService.GetAuthenticationDataByCodeAsync("<code-from-yandex-id>", cancellationToken);
- Obtain user authentication data based on the refresh token.
var authenticateData = await _yandexAuthService.GetAuthenticationDataByRefreshTokenAsync("<yandex-id-refresh-token>", cancellationToken);
- Retrieve user data from the Yandex ID service.
var yandexUserInfoResult = await _yandexAuthService.GetUserInfo("<yandex-id-access-token>", cancellationToken);
Contributing
To contribute, you will need to setup your local environment, see prerequisites. For the contribution and workflow guide, see package development lifecycle.
Prerequisites
Make sure you have installed all of the following prerequisites on your development machine:
- Git - Download & Install Git. OSX and Linux machines typically have this already installed.
- .NET (.net version) - Download & Install .NET.
Package development lifecycle
- Implement package logic in
src
- Add or change the documentation as needed
- Open pull request in the correct branch. Target the project's
master
branch
Maintainers
Product | Versions 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 was computed. 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 was computed. 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. |
-
net6.0
- Byndyusoft.ModelResult (>= 1.2.0)
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Http (>= 6.0.0)
- Microsoft.Extensions.Options (>= 8.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 8.0.0)
- System.Text.Json (>= 8.0.0)
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 |
---|---|---|
0.0.2 | 643 | 5/7/2024 |
0.0.1 | 978 | 11/29/2023 |
0.0.1-tags-1.0.0 | 82 | 11/24/2023 |