{"id":18298546,"url":"https://github.com/fusionauth/fusionauth-quickstart-dotnet-api","last_synced_at":"2025-04-05T13:33:45.832Z","repository":{"id":207816672,"uuid":"706405876","full_name":"FusionAuth/fusionauth-quickstart-dotnet-api","owner":"FusionAuth","description":null,"archived":false,"fork":false,"pushed_at":"2024-07-28T05:56:43.000Z","size":41,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":9,"default_branch":"main","last_synced_at":"2024-07-28T06:46:09.140Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FusionAuth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-17T22:15:12.000Z","updated_at":"2024-07-28T05:56:46.000Z","dependencies_parsed_at":"2023-11-17T19:55:03.940Z","dependency_job_id":"b260d347-65b5-4fc4-8962-67609447a803","html_url":"https://github.com/FusionAuth/fusionauth-quickstart-dotnet-api","commit_stats":null,"previous_names":["fusionauth/fusionauth-quickstart-dotnet-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FusionAuth%2Ffusionauth-quickstart-dotnet-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FusionAuth%2Ffusionauth-quickstart-dotnet-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FusionAuth%2Ffusionauth-quickstart-dotnet-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FusionAuth%2Ffusionauth-quickstart-dotnet-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FusionAuth","download_url":"https://codeload.github.com/FusionAuth/fusionauth-quickstart-dotnet-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223192690,"owners_count":17103564,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T15:06:21.289Z","updated_at":"2024-11-05T15:06:22.010Z","avatar_url":"https://github.com/FusionAuth.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Quickstart: ASP.NET Web API with FusionAuth\n\nThis repository contains a ASP.NET Web API that works with a locally running instance of [FusionAuth](https://fusionauth.io/), the authentication and authorization platform.\n\n## Setup\n\n### Prerequisites\n- [.NET 7+](hhttps://dotnet.microsoft.com/en-us/download): This is the main .NET framework including ASP.NET.\n- [Docker](https://www.docker.com): The quickest way to stand up FusionAuth.\n- (Alternatively, you can [Install FusionAuth Manually](https://fusionauth.io/docs/v1/tech/installation-guide/)).\n\nThis app has been tested with .NET 7. \n\n### FusionAuth Installation via Docker\n\nThe root of this project directory (next to this README) are two files [a Docker compose file](./docker-compose.yml) and an [environment variables configuration file](./.env). Assuming you have Docker installed on your machine, you can stand up FusionAuth up on your machine with:\n\n```\ndocker compose up -d\n```\n\nThe FusionAuth configuration files also make use of a unique feature of FusionAuth, called [Kickstart](https://fusionauth.io/docs/v1/tech/installation-guide/kickstart): when FusionAuth comes up for the first time, it will look at the [Kickstart file](./kickstart/kickstart.json) and mimic API calls to configure FusionAuth for use when it is first run.\n\n\u003e **NOTE**: If you ever want to reset the FusionAuth system, delete the volumes created by docker-compose by executing `docker-compose down -v`.\n\nFusionAuth will be initially configured with these settings:\n\n* Your client Id is: `e9fdb985-9173-4e01-9d73-ac2d60d1dc8e`\n* Your client secret is: `super-secret-secret-that-should-be-regenerated-for-production`\n* Your admin username is `admin@example.com` and your password is `password`.\n* Your teller username is `teller@example.com` and your password is `password`.\n* Your customer username is `customer@example.com` and your password is `password`.\n* Your fusionAuthBaseUrl is `http://localhost:9011/`\n\nYou can log into the [FusionAuth admin UI](http://localhost:9011/admin) and look around if you want, but with Docker/Kickstart you don't need to.\n\n### ASP.NET API complete-application\n\nThe `complete-application` directory contains a minimal ASP.NET API configured to authenticate with locally running FusionAuth.\n\nRun the API with:\n```\ncd complete-application/\ndotnet run\n```\n\nThe app is now serving two api endpoints\n - [http://localhost:5001/make-change](http://localhost:5001/makeChange) - this endpoint calculates the change to make from a given total\n - [http://localhost:5001/panic](http://localhost:5001/panic) - this endpoint simulates notifying the police of an incident.\n\n```sh\ncurl --location 'https://local.fusionauth.io/api/login' \\\n--header 'Authorization: this_really_should_be_a_long_random_alphanumeric_value_but_this_still_works' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n  \"loginId\": \"teller@example.com\",\n  \"password\": \"password\",\n  \"applicationId\": \"e9fdb985-9173-4e01-9d73-ac2d60d1dc8e\"\n}'\n```\n\nThe endpoints above will accept the token in either the `Authorization` header, or in a cookie. You can take the token from the response and then call one of the endpoints listed above by with a cookie by calling:\n\n```sh\ncurl --location 'http://localhost:5001/make-change?total=5.12' \\\n--cookie 'app.at=\u003cyour_token\u003e'\n```\n\nor\n\n```sh\ncurl --location --request POST 'http://localhost:5001/panic' \\\n--cookie 'app.at=\u003cyour_token\u003e'\n```\n\nTo call with a bearer token in the `Authorization` header, you can call:\n\n```sh\ncurl --location 'http://localhost:5001/make-change?total=5.12' \\\n-H 'Authorization: Bearer \u003cyour_token\u003e'\n```\n\nor \n\n```sh\ncurl --location --request POST 'http://localhost:5001/panic' \\\n-H 'Authorization: Bearer \u003cyour_token\u003e'\n```\n\n### Further Information\n\nVisit https://fusionauth.io/quickstarts/quickstart-dotnet-api for a step by step guide on how to build this ASP.NET API integrated with FusionAuth from scratch.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffusionauth%2Ffusionauth-quickstart-dotnet-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffusionauth%2Ffusionauth-quickstart-dotnet-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffusionauth%2Ffusionauth-quickstart-dotnet-api/lists"}