Giter Site home page Giter Site logo

Comments (12)

hzalaz avatar hzalaz commented on May 27, 2024

@haydenholligan you need to enable the grant Legacy: RO as detailed in https://auth0.com/docs/clients/client-grant-types#edit-available-grant_types.

However I'd recommend using https://github.com/auth0/Auth0.swift#sign-up-with-database-connection to create the user and then https://github.com/auth0/Auth0.swift#login-with-database-connection-via-realm to login the user (use the one with realm instead of connection in the parameters). This will shield you from any changes in the future since we are slowing moving away from the legacy grants, Auth0.swift 1.7.0 will have some deprecation in place and will have some documentation stating what grants each method needs (if applicable since not all perform Auth).

from auth0.swift.

haydenholligan avatar haydenholligan commented on May 27, 2024

Cool, I'll try createUser() and realm instead. Shouldn't signUp() be marked as deprecated in Xcode then? This kind of just blindly hit and was very confusing to figure out what was going on.

from auth0.swift.

hzalaz avatar hzalaz commented on May 27, 2024

It's in master pending our next release, which should be tomorrow

from auth0.swift.

hzalaz avatar hzalaz commented on May 27, 2024

Well actually it's in a PR but the same things applies

from auth0.swift.

haydenholligan avatar haydenholligan commented on May 27, 2024

Okay. I'm a little confused with the new createUser function. login() and the sold signUp() both returned Result<Credentials>, but createUser() just returns a DatabaseUser (tuple containing email, username, verified). What's the deal with that? Do I no longer store credentials on a user signup? Or do I call something else to get them? Maybe now I call login() following createUser()? I'm not entirely sure.

from auth0.swift.

hzalaz avatar hzalaz commented on May 27, 2024

Yes, the doc on the method should say this too, the createUser method just creates the User in a DB connection, then you are responsible of login them or not. The old signup did both at the same time (unless you sent a specific flag).

Now it should be something like to mirror the same behavior

let email: String = ....
let password: String = ....
Auth0
  .createUser(email: email, password: password, connection: "db_connection")
  .start { result in
    guard case .failure = .success else { return } //notify error
    Auth0
      .login(usernameOrEmail: email, password: password, realm: "db_connection")
      .start { /** Auth result */ }
  }

from auth0.swift.

haydenholligan avatar haydenholligan commented on May 27, 2024

I just noticed the quickstart guide has accessToken everywhere, my code has idToken. I'm quite sure I followed the same quickstart guide a few months ago. Was idToken replaced with accessToken?

from auth0.swift.

lbalmaceda avatar lbalmaceda commented on May 27, 2024

@haydenholligan yes, that was replaced a few months ago. Read this article for more context.

from auth0.swift.

haydenholligan avatar haydenholligan commented on May 27, 2024

I see. I figured this issue out, I'm having a new one where profile.email is nil after creating a user (the email is visible on auth0 dashboard). Should I create a new issue for that?

from auth0.swift.

lbalmaceda avatar lbalmaceda commented on May 27, 2024

AFAIK the default requested scope is openid, which will give you an access_token that you can use to call the /userinfo endpoint later. If you want the profile in the response to include the email you must also ask for the email scope when logging in (when you're obtaining the access_token). --> Ask openid email scope.

from auth0.swift.

haydenholligan avatar haydenholligan commented on May 27, 2024

Sorry, that's what I'm doing. I'm using the accessToken from login() to call userInfo().The profile I get from userInfo() has a nil email. The name is there though, set as the email address I entered...

from auth0.swift.

hzalaz avatar hzalaz commented on May 27, 2024

@haydenholligan what userInfo returns depends on the scopes during login and it will only return OIDC standard claims. To get all info you can get from userInfo you should use openid profile and that should see the email when you call https://github.com/auth0/Auth0.swift/blob/master/Auth0/Authentication.swift#L342.

If thats not the case I'd suggest you contact us via https://support.auth0.com since we cannot ask for more sensitive information here (like credentials to test, the token, etc)

from auth0.swift.

Related Issues (20)

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.