# Auth0 password grant with organization

**URL:** <https://community.auth0.com/t/auth0-password-grant-with-organization/80278>\
**Category:** Get Help\
**Tags:** organizations, password, testing\
**Created:** [March 21, 2022, 10:17pm UTC](https://community.auth0.com/t/auth0-password-grant-with-organization/80278 "2022-03-21T22:17:42Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [March 23, 2022, 8:15pm UTC](https://community.auth0.com/t/auth0-password-grant-with-organization/80278/4 "2022-03-23T20:15:31Z")

</div>

Hi @billyf,

First, when using Organizations, I suggest using the Authorization Code Grant to get tokens.

In this case, you will need to [Call the Authorization Code Flow](https://auth0.com/docs/get-started/authentication-and-authorization-flow/add-login-auth-code-flow) with the `organization` query parameter. To begin the login transaction, start by calling the `/authorize` request:

```auto
https://YOUR_DOMAIN/authorize?
    response_type=code&
    client_id=YOUR_CLIENT_ID&
    redirect_uri=https://YOUR_APP/callback&
    scope=SCOPE&
    state=STATE&
    organization=ORG_ID

```

Then exchange the code for a token by calling the `/oauth/token` endpoint:

```auto
curl --request POST \
  --url 'https://YOUR_DOMAIN/oauth/token' \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data grant_type=authorization_code \
  --data 'client_id=YOUR_CLIENT_ID' \
  --data client_secret=YOUR_CLIENT_SECRET \
  --data code=YOUR_AUTHORIZATION_CODE \
  --data 'redirect_uri=https://YOUR_APP/callback'

```

Once that is complete, you will have a valid access token.

Lastly, you may find our [Work with Tokens and Organizations](https://auth0.com/docs/manage-users/organizations/using-tokens) documentation useful.

Please let me know if you have any additional questions. I’d be happy to help.

Thank you.

---

_[View the full topic](https://community.auth0.com/t/auth0-password-grant-with-organization/80278)._
