{"id":18298542,"url":"https://github.com/fusionauth/fusionauth-quickstart-golang-api","last_synced_at":"2025-08-10T08:40:06.187Z","repository":{"id":192705295,"uuid":"686449278","full_name":"FusionAuth/fusionauth-quickstart-golang-api","owner":"FusionAuth","description":"The quickstart for Go API","archived":false,"fork":false,"pushed_at":"2025-06-10T19:15:53.000Z","size":66,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-08-10T00:33:32.902Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"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":null,"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-09-02T20:40:08.000Z","updated_at":"2025-06-10T19:15:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"fd747f5f-dab2-4fd5-8c2b-65131ebf9171","html_url":"https://github.com/FusionAuth/fusionauth-quickstart-golang-api","commit_stats":null,"previous_names":["fusionauth/fusionauth-quickstart-go-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FusionAuth/fusionauth-quickstart-golang-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FusionAuth%2Ffusionauth-quickstart-golang-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FusionAuth%2Ffusionauth-quickstart-golang-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FusionAuth%2Ffusionauth-quickstart-golang-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FusionAuth%2Ffusionauth-quickstart-golang-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FusionAuth","download_url":"https://codeload.github.com/FusionAuth/fusionauth-quickstart-golang-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FusionAuth%2Ffusionauth-quickstart-golang-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269698276,"owners_count":24461193,"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","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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:20.842Z","updated_at":"2025-08-10T08:40:06.146Z","avatar_url":"https://github.com/FusionAuth.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Quickstart: Go Resource Server with FusionAuth\n\nThis repository contains a Go application that works with a locally-running instance of [FusionAuth](https://fusionauth.io/), the authentication and authorization platform.\n\n## Setup\n\n### Prerequisites\nYou will need the following things properly installed on your computer.\n\n* [Git](http://git-scm.com/): Presumably you already have this on your machine if you are looking at this project locally; if not, use your platform's package manager to install git, and `git clone` this repo.\n* [Go](https://go.dev/): You can download and from the go website if it is not already installed on your maching.\n* [Docker](https://www.docker.com): For standing up FusionAuth from within a Docker container. (You can [install it other ways](https://fusionauth.io/docs/v1/tech/installation-guide/), but for this example we will assume you are using Docker.)\n\nThis app was built using Go 1.21.0. This example may work on different versions of Go, but it has not been tested.\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### Go API complete-application\n\nThe `complete-application` directory contains a minimal Go app configured to authenticate with locally running FusionAuth.\n\nInstall the dependencies and run the app server with:\n```\ncd complete-application\ngo get\ngo run main.go\n```\n\nGo is now serving two api endpoints\n - [http://localhost:9001/make-change](http://localhost:9001/make-change) - this endpoint calculates the change to make from a given total\n - [http://localhost:9001/panic](http://localhost:9001/panic) - this endpoint simulates notifying the police of an incident.\n\nYou can login with a user preconfigured during Kickstart, `teller@example.com` with the password of `password` and `applicationId` by calling:\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\nYou can take the token from the response and then call one of the endpoints listed above by calling:\n\n```sh\ncurl --location 'http://localhost:9001/make-change?total=5.12' \\\n--header 'Authorization: Bearer {replaceWithToken}'\n```\n\nor\n\n```sh\ncurl --location --request POST 'http://localhost:9001/panic' \\\n--header 'Authorization: Bearer {replaceWithToken}'\n```\n\n\n\n### Further Information\n\nVisit [https://fusionauth.io/docs/quickstarts/quickstart-go-api](https://fusionauth.io/docs/quickstarts/quickstart-golang-api) for a step-by-step guide on how to build this Go API from scratch.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffusionauth%2Ffusionauth-quickstart-golang-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffusionauth%2Ffusionauth-quickstart-golang-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffusionauth%2Ffusionauth-quickstart-golang-api/lists"}