in Education by
I am using php oauth2 library from this github repo. PHP oauth2 library Whenever i send a refresh token, I receive new access token with old scopes. But i want to change the scopes returned with new access token. When i first generate a token using user credentials grant type, I get the supported scopes for the user and store them this way. $defaultScope = implode(" ", $scopes);$memory = new OAuth2\Storage\Memory(array('default_scope' =>$defaultScope)); $scopeUtil = new OAuth2\Scope($memory); $this->server->setScopeUtil($scopeUtil); $this->server->handleTokenRequest(OAuth2\Request::createFromGlobals())->send(); where $scopes is an array for example $scopes=array("ADDUSER","EDITUSER","EDITROLE"); similarly , if i send refresh token using refresh_token grant type and run this with modified $scopes for example $scopes=array("ADDUSER", "EDITROLE"); $defaultScope = implode(" ", $scopes);$memory = new OAuth2\Storage\Memory(array('default_scope' =>$defaultScope)); $scopeUtil = new OAuth2\Scope($memory); $this->server->setScopeUtil($scopeUtil); $this->server->handleTokenRequest(OAuth2\Request::createFromGlobals())->send(); I receive same old scopes("ADDUSER EDITUSER EDITROLE") which were set when new access token generated using user credentials grant type. SO is there a way to change scopes when new access token is generated using refresh token ? or am i doing something wrong here? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
A Client can "down-scope" when it asks for a new access token in the refresh token grant, see the documentation around scope in the spec here: https://www.rfc-editor.org/rfc/rfc6749#section-6 Yet your Authorization server may or may not support that.

Related questions

0 votes
    I'm trying to use the Power BI REST API, using an access token acquired with the "client credentials" method, ... What am I missing? Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    When a query is submitted in Drill, client/application sends the query in the form of an _____________ to Drillbit in a ... of the options c)None of the options d)NoSQL statement...
asked Dec 11, 2020 in Education by Editorial Staff
0 votes
    I use a QWebSocketServer with Qt5.8. Most of the WebSocket clients have no troubles connecting to it, but ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 22, 2022 in Education by JackTerrance
0 votes
    Write a program which sends the name of a text file from the client to server and display the message on the ... file present or not. Select the correct answer from above options...
asked Dec 1, 2021 in Education by JackTerrance
0 votes
    If a client sends an XML request to a server, can we ensure that the communication remains confidential?...
asked Nov 7, 2020 in Education by Editorial Staff
0 votes
    In _________ model, the configuration server automatically sends the updated configuration file if there is any change. 1. Both the options 2. Push 3. Pull...
asked Sep 18, 2021 in Technology by JackTerrance
0 votes
    for a few users (maybe not that few, considering the number of related mails I'm receiving) the ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    I've following two path path1- test/hello/hello.php path2- test/hello1/hello1.php //notice the one ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 19, 2022 in Education by JackTerrance
0 votes
    I've following two path path1- test/hello/hello.php path2- test/hello1/hello1.php //notice the one ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 17, 2022 in Education by JackTerrance
0 votes
    Is there any way to change the default datatype when importing an Excel file into Access? (I'm using ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 23, 2022 in Education by JackTerrance
0 votes
    Is there any way to change the default datatype when importing an Excel file into Access? (I'm using ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 23, 2022 in Education by JackTerrance
0 votes
    Is there any way to change the default datatype when importing an Excel file into Access? (I'm using ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 23, 2022 in Education by JackTerrance
0 votes
    Is there any way to change the default datatype when importing an Excel file into Access? (I'm using ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 19, 2022 in Education by JackTerrance
0 votes
    ________ is the entity for issuing digital certificates. (a) Certificate Authority (CA) (b) Cert Authority (CA) ( ... Security questions and answers pdf, mcq on Cyber Security pdf,...
asked Nov 5, 2021 in Education by JackTerrance
0 votes
    What happens when an application takes user inputted data and sends it to a web browser without proper validation ... 2. Insecure direct object reference 3. Cross Site Scripting...
asked Mar 20, 2021 in Technology by JackTerrance
...