Reauthentication after session in volley

I am new to the volley library and will try to figure out what is the best way to do the following.

My REST Api first uses basic authentication, and if that succeeds, they return the access token that will be used from this point. Since my Acces token may expire, this is a requirement.

  • I want to call api method http://myserver/test
  • I will be back 401 (Unauthorized).
  • I want to call http://myserver/authusing basic authentication
  • I am returning an access token
  • Set title "Authentication: Session " + AccessToken
  • I want to "repeat" the request http://myserver/test.

Update

So basically I want to do this. If the request failed with the given status code, I want to make another request and then repeat the first one.

Thanks in advance!

+4
1

, Volley.   , , , , , .

, , oldTemp Listeners, .

Volley handle session expired

PlayStore .

+1

All Articles