Coder Social home page Coder Social logo

royalamrah / dependency-track-demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fusionauth/fusionauth-example-asp-netcore5

0.0 0.0 0.0 684 KB

dependency-track-demo

License: Apache License 2.0

Shell 4.97% JavaScript 1.48% C# 54.86% CSS 8.79% HTML 29.91%

dependency-track-demo's Introduction

This repo is out of date and is archived. Check out an updated tutorial on using FusionAuth with Angular or the updated GitHub repository.

Example ASP.NET Core web application

An ASP.NET Core web application using FusionAuth as the identity server. This application will use an OAuth Authorization Code workflow and the PKCE extension to log users in.

PKCE stands for Proof Key for Code Exchange, and is often pronounced "pixie". The feature is enabled by default by the netcore oauth library.

You need to have dotnetcore installed to run this code. Please note that this application uses netcore 5.0.

See the blog post for more details about setting up FusionAuth: Securing an ASP.NET Core Razor Pages app with OAuth. That blog post was written for dotnet3.1, but the FusionAuth setup is identical.

Windows install

To deploy and run on Windows, assuming you have the dotnetcore 5.0 runtime installed:

  • Open up a terminal (these instructions assume a cmd window)
  • cd SampleApp
  • Update appsettings.json with the FusionAuth application ClientId and the Authority as necessary.
  • Export the client secret as an environment variable: set SampleApp__ClientSecret="..."
  • Publish the binary: dotnet publish -r win-x64
  • Run the application: bin\Debug\netcoreapp5.0\win-x64\publish\SampleApp.exe

Visit the local webserver at http://localhost:5000/ and sign in.

Mac install

See the blog post for more details about setting up FusionAuth: Securing an ASP.NET Core Razor Pages app with OAuth. Note that the blog post was written with netcore3.1 in mind, but the FusionAuth setup won't differ.

If you are using a mac, use this command brew install dotnet, to setup the development environment.

  • Open up a terminal (these instructions assume a cmd window)
  • cd SampleApp
  • Update appsettings.json with the FusionAuth application ClientId and the Authority as necessary.
  • export SampleApp__ClientSecret="..."
  • dotnet publish -r osx.10.14-x64
  • bin/Debug/netcoreapp5.0/osx.10.14-x64/publish/SampleApp

Visit the local webserver at http://localhost:5000/ and sign in.

Claims checking

You need to add policies to check claims.

https://docs.microsoft.com/en-us/aspnet/core/security/authorization/policies?view=aspnetcore-6.0 has more details about checking policies.

Misc

See more deployment options: https://docs.microsoft.com/en-us/dotnet/core/deploying/

We also have a dotnetcore3.1 example application.

You can see additional configuration to retrieve the roles in this forum post

dependency-track-demo's People

Contributors

amans330 avatar mooreds 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.