Auth0 Home Blog Docs

Add access token to login email and password

login

#1

im using the auth0manager and im trying to use login with email and password but I always keep getting unauthorized , im trying to add the access token to the authentification process but I don’t know how,
how can I add the access token to the header of authentication?
im using this function.

Auth0

        .authentication()
        .login(
            usernameOrEmail: email,
            password: password,
            realm: connectionDB,
            scope: scopes
         )

        .start { result in
            switch result {
            case .success(let credentials):
                print("Obtained credentials: \(credentials)")

case .failure(let error):
                    print(error)
                    failure(authError)
                }

#2

Can you give us a little bit more info about your use case? What is it that you are trying to accomplish? And what frameworks are you working in?

-Jeremy


#3

im trying to login using mail and password while im activating the client credentials , so im following those steps
1-get acces token with email and password with
url:https://{{auth0_domain}}/oauth/token ,params: grant_type, client_id, audience, username, password, scope
2-after i get an access token i use it to get the user info using:
url:https://{{auth0_domain}}/oauth/token , Headers: Authorization = Bearer “my access token”
but i keep getting unauthorized as a result