{"id":14977548,"url":"https://github.com/twin/spring-security-oauth2-client-example","last_synced_at":"2025-10-04T06:17:09.532Z","repository":{"id":106445067,"uuid":"128261831","full_name":"TwiN/spring-security-oauth2-client-example","owner":"TwiN","description":"Minimal configuration required for a Spring Boot project using Spring Security with OAuth2 client","archived":false,"fork":false,"pushed_at":"2019-08-07T02:14:31.000Z","size":138,"stargazers_count":29,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-01T11:24:39.319Z","etag":null,"topics":["java","oauth2-client","spring","spring-boot","spring-framework","spring-security","spring-security-oauth2"],"latest_commit_sha":null,"homepage":"https://twin.sh/articles/18/spring-security-how-to-configure-an-oauth2-client","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/TwiN.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},"funding":{"github":["TwiN"]}},"created_at":"2018-04-05T20:39:58.000Z","updated_at":"2024-09-16T19:09:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"6aa00fc0-e9d4-4651-a476-e84326b5b1be","html_url":"https://github.com/TwiN/spring-security-oauth2-client-example","commit_stats":{"total_commits":23,"total_committers":3,"mean_commits":7.666666666666667,"dds":0.4347826086956522,"last_synced_commit":"3fa3bd9db45cbefd025cc0546b31cd2e3c43b19a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TwiN%2Fspring-security-oauth2-client-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TwiN%2Fspring-security-oauth2-client-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TwiN%2Fspring-security-oauth2-client-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TwiN%2Fspring-security-oauth2-client-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TwiN","download_url":"https://codeload.github.com/TwiN/spring-security-oauth2-client-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238597386,"owners_count":19498396,"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":["java","oauth2-client","spring","spring-boot","spring-framework","spring-security","spring-security-oauth2"],"created_at":"2024-09-24T13:55:51.642Z","updated_at":"2025-10-04T06:17:04.492Z","avatar_url":"https://github.com/TwiN.png","language":"Java","funding_links":["https://github.com/sponsors/TwiN"],"categories":[],"sub_categories":[],"readme":"# spring-security-oauth2-client-example\n\n## Modules\n\n### minimal-sample\n\nThis module contains the minimal configuration required for a Spring Boot project using Spring Security with OAuth2 client. \n\n\n### custom-userservice-sample\n\nSame as minimal-sample, but it contains a custom OAuth2 UserService.\n\n\n## Note\n\nFor Google, it's actually possible to just use the two following properties:\n\n```properties\nspring.security.oauth2.client.registration.google.client-id=\nspring.security.oauth2.client.registration.google.client-secret=\n```\n\nBut for the sake of the example, I'll be inserting all properties.\n\n\n# Creating the API credentials\n\n- Navigate to [Google's Developer console](https://console.developers.google.com/apis/credentials/)\n- Create credentials \u003e OAuth client ID\n\n![create credentials](img/create-credentials.png)\n\n- Select **Web Application**\n- Add `http://localhost` as  Authorised JavaScript origins\n- Add `http://localhost/login/oauth2/code/google` as  Authorised redirect URIs\n\n![oauth-client-id-parameters](img/oauth-client-id-parameters.png)\n\n- Click on **Create**\n- Copy your client ID and your client secret as the value for \n`spring.security.oauth2.client.registration.google.client-id` and\n`spring.security.oauth2.client.registration.google.client-secret` respectively in the `application.properties` file.\n- Done\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwin%2Fspring-security-oauth2-client-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwin%2Fspring-security-oauth2-client-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwin%2Fspring-security-oauth2-client-example/lists"}