{"id":22268196,"url":"https://github.com/curityio/oauth-mobile-web-sso","last_synced_at":"2025-03-25T14:45:47.138Z","repository":{"id":74437587,"uuid":"572982115","full_name":"curityio/oauth-mobile-web-sso","owner":"curityio","description":"Using the nonce authenticator pattern to achieve SSO between a mobile app and a web app","archived":false,"fork":false,"pushed_at":"2022-12-20T11:55:37.000Z","size":646,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-01-30T13:31:23.550Z","etag":null,"topics":["code-example","mobile","nonce","oauth2","openid-connect","sso"],"latest_commit_sha":null,"homepage":"https://curity.io/resources/learn/nonce-authenticator-pattern/","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/curityio.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-01T12:58:31.000Z","updated_at":"2024-12-06T16:57:32.000Z","dependencies_parsed_at":"2023-02-26T18:15:59.511Z","dependency_job_id":null,"html_url":"https://github.com/curityio/oauth-mobile-web-sso","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/curityio%2Foauth-mobile-web-sso","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curityio%2Foauth-mobile-web-sso/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curityio%2Foauth-mobile-web-sso/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curityio%2Foauth-mobile-web-sso/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/curityio","download_url":"https://codeload.github.com/curityio/oauth-mobile-web-sso/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245486237,"owners_count":20623239,"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":["code-example","mobile","nonce","oauth2","openid-connect","sso"],"created_at":"2024-12-03T11:11:52.731Z","updated_at":"2025-03-25T14:45:47.102Z","avatar_url":"https://github.com/curityio.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OAuth Mobile Web SSO Code Example\n\nDemo mobile apps and SPA, to demonstrate the nonce authenticator pattern on a development computer.\\\nThis provides an additional Single Sign On (SSO) option between mobile and web apps, to prevent a double login.\n\n## Run the Code Example\n\nThe following components are called, from a mobile emulator or device.\\\nThe SPA and OAuth agent are hosted on the same domain, behind a Docker based reverse proxy.\\\nThis ensures that the HTTP-only cookies issued to the SPA are first-party:\n\n![Components](./doc/components.jpg)\n\nBuild and deploy the system with the following commands:\n\n```bash\n./build.sh\n./deploy.sh\n```\n\nTo enable a setup that works on a standalone computer, an ngrok base URL is used:\n\n```bash\nThe internet base URL is: https://c7b9-2-26-158-168.eu.ngrok.io\n```\n\nMobile and web apps running on devices or emulators then have full connectivity, over HTTPS URLs.\\\nBackend components use URLs similar to the following values:\n\n| Component | Internet URL |\n| --------- | ------------ |\n| Web Host | https://c7b9-2-26-158-168.eu.ngrok.io/spa |\n| OAuth Agent | https://c7b9-2-26-158-168.eu.ngrok.io/oauth-agent |\n| Curity Identity Server Runtime URL | https://c7b9-2-26-158-168.eu.ngrok.io |\n\nThe Curity Identity Server Admin UI is available at `https://localhost:6749/admin`.\\\nSign in with credentials `admin / Password1` to inspect the OAuth configuration.\n\n## Application Flow\n\nRun the mobile client from Android Studio or Xcode, and an unauthenticated view will be shown:\n\n| Android | iOS |\n| ------- | --- |\n| \u003cimg src=\"./doc/android-app.jpg\" /\u003e | \u003cimg src=\"./doc/ios-app.jpg\" /\u003e\n\nClick the login button and sign in as `demouser / Password1`.\n\n| Android | iOS |\n| ------- | --- |\n| \u003cimg src=\"./doc/android-login.jpg\" /\u003e | \u003cimg src=\"./doc/ios-login.jpg\" /\u003e\n\nThe authenticated view will then be presented, to enable navigation to the SPA:\n\n| Android | iOS |\n| ------- | --- |\n| \u003cimg src=\"./doc/android-navigation.jpg\" /\u003e | \u003cimg src=\"./doc/ios-navigation.jpg\" /\u003e\n\nThe mobile app posts its ID token to the nonce authenticator in order to get a one-time token.\\\nIt then passes the nonce in a query string parameter to the SPA, when loading it in a browser.\\\nThe SPA then runs an OpenID Connect redirect that authenticates the user automatically, using the nonce:\n\n| Android | iOS |\n| ------- | --- |\n| \u003cimg src=\"./doc/android-sso.jpg\" /\u003e | \u003cimg src=\"./doc/ios-sso.jpg\" /\u003e\n\n## Website Documentation\n\nSee the following resources for further information:\n\n- [Mobile Web SSO Code Example](https://curity.io/resources/learn/mobile-web-sso)\n- [Nonce Authenticator Pattern](https://curity.io/resources/learn/nonce-authenticator-pattern)\n- [Nonce Authenticator Plugin](https://github.com/curityio/nonce-authenticator)\n\n## More Information\n\nPlease visit [curity.io](https://curity.io/) for more information about the Curity Identity Server.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcurityio%2Foauth-mobile-web-sso","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcurityio%2Foauth-mobile-web-sso","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcurityio%2Foauth-mobile-web-sso/lists"}