{"id":19827323,"url":"https://github.com/sandysanthosh/springboot-oauth-github","last_synced_at":"2026-04-18T02:32:55.292Z","repository":{"id":107709176,"uuid":"145448234","full_name":"sandysanthosh/Springboot-OAuth-Github","owner":"sandysanthosh","description":"Create a OAuth using GitHub. It will provide Client ID , Client Secret key then use in Spring Boot Application.","archived":false,"fork":false,"pushed_at":"2020-10-17T07:03:57.000Z","size":56,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-05T04:29:32.648Z","etag":null,"topics":["github","java","oauth2","springboot"],"latest_commit_sha":null,"homepage":"https://sandysanthosh.github.io/Springboot-OAuth-Github/","language":"Java","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/sandysanthosh.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-20T17:15:59.000Z","updated_at":"2020-10-17T07:11:26.000Z","dependencies_parsed_at":"2023-06-25T21:09:56.357Z","dependency_job_id":null,"html_url":"https://github.com/sandysanthosh/Springboot-OAuth-Github","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sandysanthosh/Springboot-OAuth-Github","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandysanthosh%2FSpringboot-OAuth-Github","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandysanthosh%2FSpringboot-OAuth-Github/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandysanthosh%2FSpringboot-OAuth-Github/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandysanthosh%2FSpringboot-OAuth-Github/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sandysanthosh","download_url":"https://codeload.github.com/sandysanthosh/Springboot-OAuth-Github/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandysanthosh%2FSpringboot-OAuth-Github/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31953784,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"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":["github","java","oauth2","springboot"],"created_at":"2024-11-12T11:13:03.064Z","updated_at":"2026-04-18T02:32:55.269Z","avatar_url":"https://github.com/sandysanthosh.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Springboot-OAuth-Github\n\nCreate a OAuth in github https://github.com/settings/developers it will provide Client ID , Client Secret then use in Spring Boot Application.\n\n### OAuth in 3 steps:\n\n### steps 1 Pom.xml:\n\n\t\u003cdependency\u003e\n\t\t\t\u003cgroupId\u003eorg.springframework.boot\u003c/groupId\u003e\n\t\t\t\u003cartifactId\u003espring-boot-starter-oauth2-client\u003c/artifactId\u003e\n\t\t\u003c/dependency\u003e\n\n\n#### steps 2 main.java:\n\n```\npackage com.example.demo;\n\nimport java.security.Principal;\n\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\nimport org.springframework.boot.autoconfigure.security.oauth2.client.EnableOAuth2Sso;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n@SpringBootApplication\n@RestController\n@EnableOAuth2Sso\npublic class Application {\n\t\n\t@RequestMapping\n\tpublic String getName(Principal name)\n\t{\n\t\treturn \"id\" + name.getName() + \"welcome Oauth\";\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tSpringApplication.run(Application.class, args);\n\t}\n\n}\n\n```\n\n### steps 3 Application.yml:\n\n\n```\n\nsecurity:\n  oauth2:\n    client:\n       clientId: a48f56f893775afb1912\n       clientSecret: c91036f105c04d0666655f411f716c43b606d373\n       accessTokenUri: https://github.com/login/oauth/access_token\n       userAuthorizationUri: https://github.com/login/oauth/authorize\n       clientAuthenticationScheme: form\n    resource:\n      user-info-uri: https://api.github.com/user\n      prefer-token-info: false \n      \n```\n\n### Test the links:\n\nhttp://localhost:8080/\n\n\n![image](https://user-images.githubusercontent.com/11579239/96330652-9bbc6d00-1074-11eb-8154-d0e27c84c8f2.png)\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsandysanthosh%2Fspringboot-oauth-github","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsandysanthosh%2Fspringboot-oauth-github","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsandysanthosh%2Fspringboot-oauth-github/lists"}