Skip to content

Latest commit

 

History

History
82 lines (64 loc) · 1.87 KB

README.md

File metadata and controls

82 lines (64 loc) · 1.87 KB

Azure DevOps builds

Softeq.Netkit.Auth

Open source product is used to communicate people in real time. This project uses ASP.NET Core 2.2

About

This project is maintained by Softeq Development Corp.

We specialize in .NET core applications.

Get started

Initially, there are created 2 default roles and users in the database:

{
  "Roles": [
    "User",
    "Admin"
  ],
  "Users": [
    {      
      "Email": "user@test.test",
      "Password": "123QWqw!",
      "Role": "User"      
    },
    {      
      "Email": "admin@test.test",
      "Password": "123QWqw!",
      "Role": "Admin",      
    }
  ]
}

To change initial data edit SeedValues.json file

Use

To receive access and refresh token by user credentials send the following request: POST /connect/token

var values = new Dictionary<string, string>
{
	{ "grant_type", "password" },
	{ "password", "userPassword" },
	{ "username", "userName" },
	{ "scope", "offline_access" },
	{ "client_id", "clientId" },
	{ "client_secret", "clientSecret" }
};

var content = new FormUrlEncodedContent(values);
var response = await httpClient.PostAsync($"{authServerUrl}/connect/token", content);

To receive access and refresh token by refresh token send the following request: POST /connect/token

var values = new Dictionary<string, string>
{
	{ "grant_type", "refresh_token" },
	{ "scope", "offline_access" },
	{ "client_id", "clientId" },
	{ "client_secret", "clientSecret" },
	{ "refresh_token", "refreshToken" }
};

var content = new FormUrlEncodedContent(values);
var response = await httpClient.PostAsync($"{authServerUrl}/connect/token", content);

Contributing

We welcome any contributions.

License

The Query Utils project is available for free use, as described by the LICENSE (MIT).