{"id":18625895,"url":"https://github.com/jurabek/identityserver4.phonenumberauth","last_synced_at":"2025-04-11T05:30:34.789Z","repository":{"id":47514540,"uuid":"122990314","full_name":"jurabek/IdentityServer4.PhoneNumberAuth","owner":"jurabek","description":"Sample passwordless phone number authentication using OAuth in ASP.NET Core 2.2 ","archived":false,"fork":false,"pushed_at":"2022-01-20T09:01:43.000Z","size":63,"stargazers_count":98,"open_issues_count":3,"forks_count":34,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-25T09:47:47.237Z","etag":null,"topics":["asp-net-core","authentication-middleware","identityserver","identityserver4","identiy","jwt","mobile-authentication","net-core","oauth","oauth2","oidc","openid","passwordless-authentication","phone-authentication","sms-activate"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jurabek.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":"2018-02-26T15:36:37.000Z","updated_at":"2024-11-25T01:34:54.000Z","dependencies_parsed_at":"2022-09-07T17:35:13.342Z","dependency_job_id":null,"html_url":"https://github.com/jurabek/IdentityServer4.PhoneNumberAuth","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jurabek%2FIdentityServer4.PhoneNumberAuth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jurabek%2FIdentityServer4.PhoneNumberAuth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jurabek%2FIdentityServer4.PhoneNumberAuth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jurabek%2FIdentityServer4.PhoneNumberAuth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jurabek","download_url":"https://codeload.github.com/jurabek/IdentityServer4.PhoneNumberAuth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248347314,"owners_count":21088625,"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":["asp-net-core","authentication-middleware","identityserver","identityserver4","identiy","jwt","mobile-authentication","net-core","oauth","oauth2","oidc","openid","passwordless-authentication","phone-authentication","sms-activate"],"created_at":"2024-11-07T04:36:19.273Z","updated_at":"2025-04-11T05:30:34.422Z","avatar_url":"https://github.com/jurabek.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IdentityServer4.PhoneNumberAuth\nSample passwordless phone number authentication with IdentityServer4 in ASP.NET Core 3.1\n\n\u003e ATTENTION: This implementation is not fully rfc6749 complient, for creating custom `grant_type`'s follow instructions [in section 8.3](https://datatracker.ietf.org/doc/html/rfc6749#section-8.3)\n\n\u003e NOTE: To be able to test locally you can change `\"ReturnVerifyTokenForTesting : true\"` on `appsettings.json` it will returns us `verify_token` on response, however in production usages it must be removed and you should add real SMS service (Twilio, Nexmo, etc..) by implementing `ISmsServices`\n\n```console\ncurl -H \"Content-Type: application/json\" \\ \n     -X POST \\ \n     -d '{\"phonenumber\":\"+198989822\"}' \\ \n     http://localhost:62537/api/verify_phone_number\n```\n```json\n{\n    \"resend_token\": \"CfDJ8F2fHxOfr9xAtc...\",\n    \"verify_token\": \"373635\"\n}\n```\n\nAuthentication by verification token\n\n```console\ncurl -H \"Content-Type: application/x-www-form-urlencoded\" \\\n     -X POST \\ \n     -d 'grant_type=phone_number_token\u0026client_id=phone_number_authentication\u0026client_secret=secret\u0026phone_number=%2B198989822\u0026verification_token=373635' \\ \n      http://localhost:62537/connect/token\n```\n\n```json\n{\n    \"access_token\": \"CfDJ8F2fHxOfr9xAtc......\",\n    \"expires_in\": 3600,\n    \"token_type\": \"Bearer\",\n    \"refresh_token\": \"CfDJ8F2fHxOfr9xAtc....\"\n}\n```\n\nTest your api controller by Bearer token\n\n```console\ncurl -i http://localhost:62732/api/Identity \\\n     -H \"Authorization: Bearer CfDJ8F2fHxOfr9xAtc......\"\n```\n\n```json\n{\n    \"type\": \"phone_number\",\n    \"value\": \"+198989822\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjurabek%2Fidentityserver4.phonenumberauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjurabek%2Fidentityserver4.phonenumberauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjurabek%2Fidentityserver4.phonenumberauth/lists"}