{"id":15013494,"url":"https://github.com/tableflip/react-native-meteor-oauth","last_synced_at":"2025-04-12T04:44:29.628Z","repository":{"id":72910969,"uuid":"71579270","full_name":"tableflip/react-native-meteor-oauth","owner":"tableflip","description":"Oauth2 login to a Meteor server in React Native","archived":false,"fork":false,"pushed_at":"2016-10-24T08:40:00.000Z","size":17,"stargazers_count":12,"open_issues_count":2,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T00:13:13.405Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/tableflip.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":"2016-10-21T15:46:18.000Z","updated_at":"2019-08-28T04:06:51.000Z","dependencies_parsed_at":"2023-05-26T01:15:11.829Z","dependency_job_id":null,"html_url":"https://github.com/tableflip/react-native-meteor-oauth","commit_stats":{"total_commits":6,"total_committers":2,"mean_commits":3.0,"dds":"0.16666666666666663","last_synced_commit":"0d8811b0583b5b2798db0d7b200768b414bd4085"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tableflip%2Freact-native-meteor-oauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tableflip%2Freact-native-meteor-oauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tableflip%2Freact-native-meteor-oauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tableflip%2Freact-native-meteor-oauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tableflip","download_url":"https://codeload.github.com/tableflip/react-native-meteor-oauth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248519472,"owners_count":21117757,"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-09-24T19:44:21.317Z","updated_at":"2025-04-12T04:44:29.607Z","avatar_url":"https://github.com/tableflip.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-meteor-oauth\nOauth2 login to a Meteor server in React Native\n\n## How?\n\n```js\nimport React, { Component } from 'react'\nimport View from 'react-native'\nimport Meteor from 'react-native-meteor'\nimport Login from 'react-native-meteor-oauth'\n\nconst meteorHost = '192.168.1.73:3000' // Put your local IP here if running in dev\nMeteor.connect(`ws://${meteorHost}/websocket`)\n\nexport default () =\u003e {\n  return (\u003cView\u003e\n    \u003cLogin\n      provider='Github'\n      callbackUrl='http://localhost:3000/_oauth/github'\n      meteorServerDomain={meteorHost}\n      meteorServerProtocol='http'\n      clientId='YOUR_GITHUB_CLIENT_ID'\n    /\u003e\n  \u003c/View\u003e)\n}\n```\n\nThis module depends on [react-native-meteor](https://github.com/inProgress-team/react-native-meteor) under the hood, which should then be used for subscriptions, method calling and so on once login has occurred.\n\nThe react-native-meteor docs specify that you should `Meteor.connect` **only once** in your app's parent component.  The example above is reductive, but in a more realistic app this would involve having the `Meteor.connect` line in the parent component and requiring/using *react-native-meter-oauth* in subcomponents. \n\n## Which providers are supported?\n\nCurrently: **Github**, **Google** and **Facebook**.\n\nAny other provider which allow login with Oauth2 can easily be added, which unfortunately does not presently include **Twitter**.\n\n## Props\n\n* `provider` (required): one of [`\"Github\"`, `\"Google\"`, `\"Facebook\"`] for automatic config, but can be anything if you supply `url` and possibly `extraRequestParam` (see below).\n* `clientId` (required): the client ID given by the OAuth provider.\n* `callbackUrl` (required): the callback URL you specified to the OAuth provider corresponding to this `clientId`.\n* `meteorServerDomain` (required): the domain of the Meteor server you're intending to log in to. **Note** `localhost:3000` will not work here, as a device (even running in an emulator) has to connect over the (local) network.  Use your dev server's local IP in dev.\n* `meteorServerProtocol` (required): either `http` or `https`.\n* `scope` (optional): a space-delimited string of requested scopes.  Sensible but limited defaults are provided.\n* `url` (optional): the url you want to use to request authorization from the OAuth provider.  Theoretically, this (along with the param below) allows you to connect to any arbitary provider.\n* `extraRequestParams` (optional): a dictionary of extra parameters which need to be provided in the authorization request to make OAuth work.  For example, Google requires `response_type=\"code\"`, but this is already set by default.\n* `styles` (optional): a dictionary of styles to overwrite the defaults, which are as follows:\n\n```js\n{\n  buttonContainer: { flexDirection: 'row', justifyContent: 'space-around' },\n  button: { flex: -1 },\n  buttonLogin: { backgroundColor: '#bbb'},\n  buttonLogout: { backgroundColor: '#bbb'},\n  buttonLoginText: { textAlign: 'center', paddingVertical: 12, paddingHorizontal: 40 },\n  buttonLogoutText: { textAlign: 'center', paddingVertical: 12, paddingHorizontal: 40 },\n  text: { textAlign: 'center', marginBottom: 15 },\n  view: { flex: 1, alignSelf: 'stretch', justifyContent: 'center' }\n}\n```\nProvider-specific styles are also merged into these for the Github, Google and Facebook.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftableflip%2Freact-native-meteor-oauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftableflip%2Freact-native-meteor-oauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftableflip%2Freact-native-meteor-oauth/lists"}