Giter Site home page Giter Site logo

roofstacks.auth-guard's Introduction

RoofStacks.Auth-Guard

Project Description

The RoofStacks.Auth-Guard project is designed to secure Employee and Company APIs using IdentityServer4. The backend uses a PostgreSQL database, which is preferred in microservice architectures due to its easier and more cost-effective management compared to MSSQL. Each API has its own client_id and client_secret information, providing secure access.

Features

  • Authentication and authorization using OAuth 2.0 and OpenID Connect protocols through IdentityServer4.
  • Utilizes PostgreSQL database for efficient and scalable management.
  • Predefined ApiResource, ApiScope, and Client information through seed data.
  • Secure access to Employee and Company APIs.

Installation Instructions

  1. ConnectionString Settings: To set up the DbContext in the project, make sure your ConnectionString points to your PostgreSQL database in your local environment.

  2. Database Update: Run the following command via the command line or Package Manager Console: update-database.

This command will update the PostgreSQL database and create the seed data.

Usage

  1. Project Ports:

    • RoofStacks.Auth-Guard -> port https://localhost:5002
    • RoofStacks.CompanyAPI -> port https://localhost:5004
    • RoofStacks.EmployeeAPI -> port https://localhost:5006
  2. Obtaining AccessToken: You can get an AccessToken using the CURL command below. For example, to get an access token for the Employee API, use client_id=EmployeeAPP and client_secret=EmployeeAPISecret. Similarly, for the Company API, use client_id=CompanyAPP and client_secret=CompanyAPISecret.

    curl --location 'https://localhost:5002/connect/token' \
    --header 'Content-Type: application/x-www-form-urlencoded' \
    --data-urlencode 'client_id=EmployeeAPP' \
    --data-urlencode 'client_secret=EmployeeAPISecret' \
    --data-urlencode 'grant_type=client_credentials'
    curl --location 'https://localhost:5002/connect/token' \
    --header 'Content-Type: application/x-www-form-urlencoded' \
    --data-urlencode 'client_id=CompanyAPP' \
    --data-urlencode 'client_secret=CompanyAPISecret' \
    --data-urlencode 'grant_type=client_credentials'
  3. API Access: You can access the APIs within the scope of the permissions granted by the obtained AccessToken.

roofstacks.auth-guard's People

Contributors

iscaniskender 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.