{"id":21851862,"url":"https://github.com/ulbora/go-oauth2-client","last_synced_at":"2025-07-03T01:31:48.038Z","repository":{"id":57503999,"uuid":"100129858","full_name":"Ulbora/go-oauth2-client","owner":"Ulbora","description":"A client for handling OAuth2 in a golang application","archived":false,"fork":false,"pushed_at":"2020-03-02T01:40:52.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-21T18:32:41.291Z","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":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ulbora.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":null,"security":null,"support":null}},"created_at":"2017-08-12T18:14:29.000Z","updated_at":"2020-03-02T01:40:13.000Z","dependencies_parsed_at":"2022-08-28T02:01:27.575Z","dependency_job_id":null,"html_url":"https://github.com/Ulbora/go-oauth2-client","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Ulbora/go-oauth2-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ulbora%2Fgo-oauth2-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ulbora%2Fgo-oauth2-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ulbora%2Fgo-oauth2-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ulbora%2Fgo-oauth2-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ulbora","download_url":"https://codeload.github.com/Ulbora/go-oauth2-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ulbora%2Fgo-oauth2-client/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263243696,"owners_count":23436354,"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-28T01:11:49.506Z","updated_at":"2025-07-03T01:31:48.012Z","avatar_url":"https://github.com/Ulbora.png","language":"Go","readme":"go-oauth2-client\n==============\n\nMockable Go OAuth2 client for access a OAuth2 Server from a golang application\n\n# Installation\n\n```\n$ go get github.com/Ulbora/go-oauth2-client\n\n```\n\n# Usage\n\n## Auth Code Grant Type\n\n### Auth Code Authorize\n```\n    var a AuthCodeAuthorize\n    a.ClientID = \"211\"\n    a.OauthHost = \"http://localhost:3000\"\n    a.RedirectURI = \"http:/localhost/token\"\n    a.Scope = \"write\"\n    a.State = \"12345\"\n    res := a.AuthCodeAuthorizeUser()\n```\n\n### Auth Code Token\n```\n    var tn AuthCodeToken\n    tn.OauthHost = \"http://localhost:3000\"\n    tn.ClientID = \"403\"\n    tn.Secret = \"554444vfg55ggfff22454sw2fff2dsfd\"\n    tn.Code = \"yfgk5mj481QSl46n2zIZGl\"\n    tn.RedirectURI = \"http://www.google.com\"\n    token := tn.AuthCodeToken()\n\n```\n\n### Auth Code Refresh\n\n```\n    var tn AuthCodeToken\n    tn.OauthHost = \"http://localhost:3000\"\n    tn.ClientID = \"403\"\n    tn.Secret = \"554444vfg55ggfff22454sw2fff2dsfd\"\n    tn.RefreshToken = \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJjb2RlIiwidXNlcklkIjoia2VuIiwiY2xpZW50SWQiOjQwMywiaWF0IjoxNTAyNDE4NDQ1LCJ0b2tlblR5cGUiOiJyZWZyZXNoIiwiZXhwIjoxNTAyNDU0NDQ1LCJpc3MiOiJVbGJvcmEgT2F1dGgyIFNlcnZlciJ9.7rJPyXkVppTS_4_b3K8nUdnnrjmZI0R69_F7ii5_ueA\"\n    token := tn.AuthCodeRefreshToken()\n\n```\n## Implicit Grant Type\n\n### Implicit Authorize\n\n```\n    var a ImplicitAuthorize\n    a.ClientID = \"403\"\n    a.OauthHost = \"http://localhost:3000\"\n    a.RedirectURI = \"http://www.google.com\"\n    a.Scope = \"read\"\n    a.State = \"12345\"\n    res := a.ImplicitAuthorize()\n\n```\n## Client Credentials Grant Type\n\n### Client Credentials Token\n\n```\n    var tn ClientCredentialsToken\n    tn.OauthHost = \"http://localhost:3000\"\n    tn.ClientID = \"403\"\n    tn.Secret = \"554444vfg55ggfff22454sw2fff2dsfd\"\n    token := tn.ClientCredentialsToken()\n\n```\n\n## Password Grant Type\nNot supported\n\n## Returned Token for grant types Auth Code, Refresh, and Client Credentials\n\n```\ntype Token struct {\n    AccessToken   string `json:\"access_token\"`\n    RefreshToken  string `json:\"refresh_token\"`\n    TokenType     string `json:\"token_type\"`\n    ExpiresIn     int    `json:\"expires_in\"`\n    ErrorReturned string `json:\"error\"`\n}\n```\n\n## Returned by Implicit\nImplicit grand type calls the redirect URI and passes the token as a query parm.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fulbora%2Fgo-oauth2-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fulbora%2Fgo-oauth2-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fulbora%2Fgo-oauth2-client/lists"}