Giter Club home page Giter Club logo

auth0-example's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

auth0-example's Issues

Logout

Hi,

Thanks for this example. I'm struggling with logout: I've tried this, but without success:

await WebBrowser.openBrowserAsync(
  "https://goferworkondemand.eu.auth0.com/v2/logout",
)

How should I logout my user? Thanks for your help.

Unable to retrieve id_token, username instead getting access_token

I tried to make it work using facebook; its crashing and doenst provide id_token instead i am getting access_token in the response url :

yo: exp://x.....exp.direct/+/redirect#access_token=BfHzspLFaOiXXXX&expires_in=7200&scope=openid&token_type=Bearer&state=exp%3A%2F%2Fx........exp.direct%2F%2B%2Fredirect
7:00:42 PM
Object {
  "access_token": "BfHzspLFaOiXXXX",
  "expires_in": "7200",
  "scope": "openid",
  "state": "exp%3A%2F%2Fxjxxxxx........exp.direct%2F%2B%2Fredirect",
  "token_type": "Bearer",
}
7:00:43 PM
Possible Unhandled Promise Rejection (id: 0):
[InvalidTokenError: Invalid token specified: undefined is not an object (evaluating 'str.replace')]

Response doesn't seem correct for the example

If I use just the example, straight from a clone, it fails. At least when I tried with Google and Facebook. From what I could tell, the response wasn't encoded, but just a JWT.

To get the example to work, I had to add/change response_type, scope, nonce, audience to the startAsync call.
Can someone confirm this or why and if so I will submit a PR.

My modified piece

  _loginWithAuth0 = async () => {
    const redirectUrl = AuthSession.getRedirectUrl();
    console.log(`Redirect URL (add this to Auth0): ${redirectUrl}`);
    const result = await AuthSession.startAsync({
      authUrl: `${auth0Domain}/authorize` + toQueryString({
        client_id: auth0ClientId,
        response_type: 'id_token',
        scope: 'openid email profile',
        audience: 'https://example.auth0.com/userinfo',
        nonce: await this.getNonce(),
        redirect_uri: redirectUrl,
      }),
    });

I upgraded this proj to expo 36, but cant open open pull request

I opened a branch to upgrade expo to 33.0.0 but can't push to a branch. is it because I cloned with Https?
I tried to clone by ssh but:

Cloning into 'auth0-example'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

Can you add permissions?

undefined is not an object (evaluating '_expo.AuthSession.startAsync')

I'm trying to dispatch this function:

export const login = () => async (dispatch) => {
   let res = await AuthSession.startAsync({
     authUrl:
       'https://creato.eu.auth0.com/authorize' +
       toQueryString({
         connection: 'linkedin',
         client_id: 'myId',
         response_type: 'token',
         scope: 'openid name',
         redirect_uri: 'https://auth.expo.io/@alexbidiuk/binder',
       }),
   });
   console.warn(res);
};

But all time receive this errors:

Possible Unhandled Promise Rejection (id: 0):
TypeError: undefined is not an object (evaluating '_expo.AuthSession.startAsync')

Is it possible to use localhost in the redirect for dev environment?

LOVE this tutorial, it was super easy to follow and worked perfectly as a template for my own app's login page :)

Question though... why do we have to use the exp://...direct address for the redirect? Could (in dev mode) we set it to localhost?

My flow is:
Click Login -> Popup WebView with my server's login -> Hit callback url via Linking eventListener

After authentication not redirecting back to app

Hi,
We are trying to use auth0 and Expo's AuthSession to authenticate users in a browser and then direct them back to the application with the token, etc..
Right now when using

exp start
and testing on iOS and Android through expo app, we see the auth0 lock screen and then it redirects back to our app perfectly.

But after building standalone ipa and apk files from the auth0 lock screen success it redirect

https://expo.io/@myuser/{project-slug}/+expo-auth-session#access_token=[TOKEN]&scope=openid&expires_in=7200&token_type=Bearer&state=[somevalue]
The page shows "404. Looks like the page you are looking for does not exist. Here are some links to bring you back to Expo", and there are 3 options: return home, log in to your account, create an account.

We expect the app to actually close the browser with the access token. Any help would be really great. Thanks

Our project is configured using
"expo": "^21.0.2" "react": "^16.0.0-alpha.12" "react-native": "https://github.com/expo/react-native/archive/sdk-21.0.2.tar.gz",

We are using the following commands to generate apk and ipa.

exp build:android
exp build:ios

Authorization Code Grant Flow with PKCE

Hey there, I'd like to request input or discussion on using Auth0's PKCE flow that allows for a refresh token in addition to the standard id token and access token.

The standard Implicit flow works fine, as demonstrated in the example code. This flow is important in mobile applications, and example here would be extremely valuable and helpful for those using the Expo flavor of React Native and integrating with Auth0. Their documentation makes use of the Node crypto library, which appears to be unavailable in a React Native app.

What settings should be updated exactly?

In the README is mentioned

In the application settings, you must add the redirect URL for your Expo application that is coming from the AuthSession module (built-in in Expo).

But what are the specific settings that must be updated with the expo auth URL? The allowed callback URLs? The Application Login URI?

Currently whenever I click on the button to login it redirects me somewhere else and then back to the application, the Auth0 login doesn't even show up, and this is the error I get in the Expo panel:

Info
21:37
Redirect URL: https://auth.expo.io/@oxyrus/auth0-example
Info
21:37
Authentication response Object {
  "errorCode": "cookies-disabled",
  "params": Object {},
  "type": "error",
  "url": "exp://8n-nth.oxyrus.auth0-example.exp.direct:80/--/expo-auth-session?errorCode=cookies-disabled",
}

Android not dismissing Chrome custom tab with WebBrowser.dismissBrowser()

Hi guys. I'm not having any luck getting this to work properly with Android 7.1.1.
If you want to see it, I have a video taken from my phone, not an emulator. It's weird, you can kind of see it dismiss something but then the browser remains in the foreground. Let me know what else I can provide to to help troubleshoot.

You can hit me up in the Exponent Slack via DM if you want the video. Can't post here. :/

Сallback URL (Redirect URL) for multiple users

Hi guys.
Please clarify how to setup callback url properly for multiple users.

In the provided auth0 expo example callback url is generated this way:
const redirectUrl = AuthSession.getRedirectUrl();
And it gives a callback in the format:
https://auth.expo.io/@your-username/your-expo-app-slug
In my case it is:
https://auth.expo.io/@boba111/awesomeapp
And it works fine but only for a single user boba111.

In case I use react-native without expo I don't have this issue because callback url on the auth0 website is configured this way:
{PRODUCT_BUNDLE_IDENTIFIER}://darmikon.eu.auth0.com/ios/{PRODUCT_BUNDLE_IDENTIFIER}/callback
In my case it looks like this
com.awesomeapp://boba111.eu.auth0.com/ios/com.awesomeapp/callback

So how to setup callback url so that auth0 works for production for any number of users?
Is any way to setup kind of wildcard callback url for expo + auth0?

Thanks in advance

Any work around for id_token?

For now, Auth0 removed support for Legacy: Delegation ID Token. You have to manually contact with them to enable this option. Is there any other solution to connect expo app with Auth0?

image

Callback URL help

I'm testing this out with Twitter. When I use the _loginWithAuth0() method I get navigated correctly to the Auth0 with the Twitter option and the email/password option. However, when I select Twitter I get an error in my simulator stating:

Callback URL not approved for this client application. Approved callback URLs can be adjusted in your application settings.

and the logs show:

Object {
  "errorCode": undefined,
  "params": Object {
    "error": "access_denied",
    "error_description": "Callback URL not approved for this client application. Approved callback URLs can be adjusted in your application settings",
    "exp://localhost:19000/--/expo-auth-session": "",
  },
  "type": "success",
  "url": "exp://localhost:19000/--/expo-auth-session#error=access_denied&error_description=Callback%20URL%20not%20approved%20for%20this%20client%20application.%20Approved%20callback%20URLs%20can%20be%20adjusted%20in%20your%20application%20settings",
}

However, if I use the _loginWithAuth0Twitter() method I simply get the same error above, nothing opens in the webview. I've tried setting up my Auth0 application callback URLS as such:

https://auth.expo.io/@USERNAME/SLUG,
https://auth.expo.io/@USERNAME/SLUG/callback,
expo://APPLICATION.auth0.com/ios/SLUG/callback,
exp://localhost:19000/--/expo-auth-session,
exp://localhost:19000/--/expo-auth-session/callback

and my Twitter App callback URLs are set as:

https://auth.expo.io/@USERNAME/SLUG,
https://APPLICATION.auth0.com

Can someone take a look at their callback URLs and give me a suggestion please. Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.