GithubHelp home page GithubHelp logo

simpleauthnet's Introduction

SimpleAuthNet API Documentation

This documentation provides an overview of the SimpleAuthNet API, an authentication and authorization system built with ASP.NET using .NET 8.

Table of Contents

Authentication

Register

Registers a new user.

URL: /User/Register

Method: POST

Request Body:

{
  "email": "[email protected]",
  "password": "password123"
}

Response:

{
  "isSucceed": true,
  "messages": {},
  "data": true
}

Login

Authenticates a user and returns an access token and refresh token.

URL: /User/Login

Method: POST

Request Body:

{
  "email": "[email protected]",
  "password": "password123"
}

Response:

{
  "isSucceed": true,
  "messages": {},
  "data": {
    "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "refreshToken": "abc123..."
  }
}

Refresh Token

Refreshes the access token using a refresh token.

URL: /User/RefreshToken

Method: POST

Request Body:

{
  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "refreshToken": "abc123..."
}

Response:

{
  "isSucceed": true,
  "messages": {},
  "data": {
    "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "refreshToken": "def456..."
  }
}

Logout

Logs out the currently authenticated user.

URL: /User/Logout

Method: POST

Response:

{
  "isSucceed": true,
  "messages": {},
  "data": true
}

User Profile

Get User Profile

Retrieves the profile information of the authenticated user.

URL: /User/Profile

Method: POST

Headers:

  • Authorization: Bearer <access_token>

Response:

Weather Forecast

Get Weather Forecast

Retrieves a weather forecast.

URL: /api/WeatherForecast

Method: GET

Headers:

  • Authorization: Bearer <access_token>

Response:

[
  {
    "date": "2023-06-01T00:00:00",
    "temperatureC": 25,
    "summary": "Warm"
  },
  ...
]

Build Process

To build the SimpleAuthNet project using the dotnet CLI, follow these steps:

  1. Ensure that you have the .NET SDK installed on your machine. You can download it from the official Mixcrosoft website: .NET SDK

  2. Clone this repository to your local machine using the following command:

    git clone [repository_url]
    
  3. Open a terminal or command prompt and navigate to the root directory of the SimpleAuthNet project:

    cd SimpleAuthNet
    
  4. Run the following command to restore the project dependencies:

    dotnet restore
    
  5. Once the dependencies are restored, run the following command to build the project:

    dotnet build
    

    This command will compile the project and generate the output in the bin directory.

  6. (Optional) If you want to run the tests, use the following command:

    dotnet test
    

    This will execute the unit tests defined in the project.

  7. To run the application, use the following command:

    dotnet run
    

    This will start the application, and you can access it via the specified URL (e.g., http://localhost:5023).

That's it! You have now successfully built and run the SimpleAuthNet project using the dotnet CLI.

simpleauthnet's People

Contributors

parsaza79 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.