# Need some clarifications about API Authorization from an SPA

**URL:** <https://community.auth0.com/t/need-some-clarifications-about-api-authorization-from-an-spa/8676>\
**Category:** Get Help\
**Tags:** spa, api-authorization\
**Created:** [November 6, 2017, 5:19pm UTC](https://community.auth0.com/t/need-some-clarifications-about-api-authorization-from-an-spa/8676 "2017-11-06T17:19:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fmeriot](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/fmeriot/32/7420_2.png) [@fmeriot](https://community.auth0.com/u/fmeriot)\
**Post date:** [November 6, 2017, 5:19pm UTC](https://community.auth0.com/t/need-some-clarifications-about-api-authorization-from-an-spa/8676/1 "2017-11-06T17:19:19Z")

</div>

Hello,  
I need some clarifications about API authorization from an SPA. In the doc I noticed this paragraph about how to determine a user’s scope

* * *

_Determine a User’s Scopes_

_You can use scopes to make decisions about the behavior of your application’s interface._

_You can specify which scopes you want to request at the beginning of the login process._

_If a scope you requested is available to the user, their access token receives a scope claim in the payload. The value of this claim is a string with all the granted scopes, but your application must treat the access token as opaque and must not decode it. This means that you cannot read the access token to access the scopes._

_To get the scopes, you can use the value of the scope parameter that comes back after authentication. This parameter is a string containing all the scopes granted to the user, separated by spaces. This parameter will be populated only if the scopes granted to the user are different than those you requested._

_To see which scopes are granted to the user, check for the value of authResult.scope. If there is no value for authResult.scope, all the requested scopes were granted._

* * *

If I understand, during the login process I need to ask for the scopes the user need to have to use the SPA. For example, my SPA needs read:article, publish:article and delete:article and supposed that my user just have the read:article permission. So, a token will be forged with only the read:article scope.  
What is not very clear to me is where my SPA can get this user’s scope in order to hide/display the “edit” and “delete” buttons.

These 2 sentences :

_you cannot read the access token to access the scopes_

and

_To get the scopes, you can use the value of the scope parameter that comes back after authentication_

need some clarification.

Thank you for your help

---

<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:** [March 2, 2018, 5:57am UTC](https://community.auth0.com/t/need-some-clarifications-about-api-authorization-from-an-spa/8676/2 "2018-03-02T05:57:18Z")

</div>


