# Authentication API Organization and Permission Claims

**URL:** <https://community.auth0.com/t/authentication-api-organization-and-permission-claims/185497>\
**Category:** Get Help\
**Tags:** apis, application\
**Created:** [April 15, 2025, 1:11pm UTC](https://community.auth0.com/t/authentication-api-organization-and-permission-claims/185497 "2025-04-15T13:11:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sevo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sevo/32/25777_2.png) [@sevo](https://community.auth0.com/u/sevo)\
**Post date:** [April 15, 2025, 1:11pm UTC](https://community.auth0.com/t/authentication-api-organization-and-permission-claims/185497/1 "2025-04-15T13:11:15Z")

</div>

I’ve been exploring creating a custom login experience for my users. This lead me down utilizing my backend for authentication operations via the Java Auth0 Client based on the Authentication API. This worked great for retrieving the id/access tokens with standard claims.

However, my application uses organizations. My API is configured with RBAC enabled and with the _Add Permission in the Access Token_ toggled on. The tokens are fine and include the relevant claims when using the SPA and React SDKs. However, I can’t figure out how to login via my Spring Boot backend and have Auth0 give me back a token with those organization related claims.

Here is my code:

```auto
    @PostMapping("/login")
    public ResponseEntity<?> login(@RequestBody LoginRequest request) {
        try {
            char[] passwordChars = request.getPassword().toCharArray();

            // Create the auth request with the original syntax you prefer
            Request<TokenHolder> authRequest = authAPI.login(request.getUsername(), passwordChars)
                    .setScope("openid profile email offline_access")
                    .setAudience(audience)
                    .setRealm("some-db")
                    .addParameter("org_id", "org_SOME_ORG_ID")
                    .addParameter("organization", "some-org-name");

            com.auth0.net.Response<TokenHolder> response = authRequest.execute();
            TokenHolder holder = response.getBody();

            return ResponseEntity.ok(new AuthResponse(
                    holder.getAccessToken(),
                    holder.getRefreshToken(),
                    holder.getIdToken(),
                    holder.getExpiresIn()));

        } catch (Auth0Exception e) {
            Map<String, String> error = new HashMap<>();
            error.put("error", e.getMessage());
            return ResponseEntity.status(HttpStatus.UNAUTHORIZED).body(error);
        }
    }

```

This gives no errors and gives back the tokens without the organization related claims. What am I doing wrong here? Is this possible?

I am on the Essentials Tier. The Java Auth0 Client dep is `'com.auth0:auth0:2.14.0'`

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![gerald.czifra](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gerald.czifra/32/75301_2.png) [@gerald.czifra](https://community.auth0.com/u/gerald.czifra)\
**Post date:** [May 13, 2025, 9:08pm UTC](https://community.auth0.com/t/authentication-api-organization-and-permission-claims/185497/3 "2025-05-13T21:08:37Z")

</div>

Hi there,

Thank you for reaching out to us!

Reading through your code, my understanding is that you are trying to implement this using ROPG ( Resource Owner Password Grant ), which at this moment does not support Organization parameters or authentication flows through Auth0’s Organization.

Although we do not have an ETA for this feature, others have voted on it’s implementation and have also shared a potential workaround in the following [Product Feedback](https://community.auth0.com/t/add-organization-support-for-resource-owner-password-flow/123546), but please do keep in mind that the workaround was not provided by an internal Engineer. I do encourage you to also vote on this feature, which will help expedite it’s development.

If a different flow type can be used, we would be happy to take a look and further assist where possible!

Have a great one!  
Gerald

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [May 27, 2025, 9:09pm UTC](https://community.auth0.com/t/authentication-api-organization-and-permission-claims/185497/4 "2025-05-27T21:09:36Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
