[ 
https://issues.apache.org/jira/browse/SHINDIG-1711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13219577#comment-13219577
 ] 

[email protected] commented on SHINDIG-1711:
--------------------------------------------------------



bq.  On 2012-02-29 21:43:25, Henry Saputra wrote:
bq.  > 
http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/oauth2/BasicOAuth2Request.java,
 line 563
bq.  > <https://reviews.apache.org/r/3987/diff/2/?file=86671#file86671line563>
bq.  >
bq.  >     Wouldnt we want to check for forbidden?

bq. From talking to Adam and reading the spec, no.  
http://tools.ietf.org/html/draft-ietf-oauth-v2-bearer-16#section-3.1

   insufficient_scope
         The request requires higher privileges than provided by the
         access token.  The resource server SHOULD respond with the HTTP
         403 (Forbidden) status code and MAY include the "scope"
         attribute with the scope necessary to access the protected
         resource.

Basically this means that even if we got a new token we still wouldn't have 
permissions.  It's not that the token is bad (in fact it's a valid access 
token), we simply don't have permissions to access the resource.  In the 403 
case the user could get a new token but the request would still fail.


- Stanton


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/3987/#review5469
-----------------------------------------------------------


On 2012-02-29 21:30:23, Stanton Sievers wrote:
bq.  
bq.  -----------------------------------------------------------
bq.  This is an automatically generated e-mail. To reply, visit:
bq.  https://reviews.apache.org/r/3987/
bq.  -----------------------------------------------------------
bq.  
bq.  (Updated 2012-02-29 21:30:23)
bq.  
bq.  
bq.  Review request for shindig, li xu and Adam Clarke.
bq.  
bq.  
bq.  Summary
bq.  -------
bq.  
bq.  From JIRA:
bq.  If the url to which a gadget is doing a makeRequest doesn't exist, i.e., 
returns a 404 to the Shindig server, the access token is being removed from the 
OAuth2 Store. This functionality is implemented here: 
org.apache.shindig.gadgets.oauth2.BasicOAuth2Request.fetchFromServer(OAuth2Accessor,
 HttpRequest)
bq.  
bq.  fetchFromServer is checking only if the response code is 4xx, and if so, 
it is removing the access token from the store. This seems right for 401 or 403 
return codes, perhaps, but not for 404. The behavior for an end user would then 
be that they have to do the OAuth dance again next time the gadget tries to 
access a resource.
bq.  
bq.  The proposal is to change the current implementation to look explicitly 
for 401 or 403 response codes in fetchFromServer instead of looking for any 
4xx. 
bq.  
bq.  Any other recommendations on what the behavior should be are welcome.
bq.  
bq.  
bq.  This addresses bug SHINDIG-1711.
bq.      https://issues.apache.org/jira/browse/SHINDIG-1711
bq.  
bq.  
bq.  Diffs
bq.  -----
bq.  
bq.    
http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/oauth2/BasicOAuth2Request.java
 1295256 
bq.  
bq.  Diff: https://reviews.apache.org/r/3987/diff
bq.  
bq.  
bq.  Testing
bq.  -------
bq.  
bq.  Built and ran existing JUnits.
bq.  
bq.  
bq.  Thanks,
bq.  
bq.  Stanton
bq.  
bq.


                
> OAuth2 access tokens being removed from OAuth2Store when request returns any 
> 4xx response
> -----------------------------------------------------------------------------------------
>
>                 Key: SHINDIG-1711
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1711
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: 2.5.0
>            Reporter: Stanton Sievers
>            Assignee: Stanton Sievers
>              Labels: OAuth2
>             Fix For: 2.5.0
>
>
> If the url to which a gadget is doing a makeRequest doesn't exist, i.e., 
> returns a 404 to the Shindig server, the access token is being removed from 
> the OAuth2 Store.  This functionality is implemented here: 
> org.apache.shindig.gadgets.oauth2.BasicOAuth2Request.fetchFromServer(OAuth2Accessor,
>  HttpRequest)
> fetchFromServer is checking only if the response code is 4xx, and if so, it 
> is removing the access token from the store.  This seems right for 401 or 403 
> return codes, perhaps, but not for 404.  The behavior for an end user would 
> then be that they have to do the OAuth dance again next time the gadget tries 
> to access a resource.  
> The proposal is to change the current implementation to look explicitly for 
> 401 or 403 response codes in fetchFromServer instead of looking for any 4xx.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to