I have a Ruby on Rails app that uses Doorkeeper to turn it into an OAuth 2.0 provider. Now I am creating an iPhone client for the application which uses the gtm-oauth2 library. The library has the following method to check for the refresh token and authentication token:
- (BOOL)canAuthorize {
NSString *token = self.refreshToken;
if (token == nil) {
// For services which do not support refresh tokens, we'll just check
// the access token.
token = self.authorizationToken;
}
BOOL canAuth = [token length] > 0;
return canAuth;
}
As you can see, the method checks if the refresh token is nil. The condition is never met because, as it turns out, self.refreshToken is actually [NSNull null]. With the refresh token flow disabled on the server, the self.refreshToken in the code above should be nil not [NSNull null]. That made me believe that when retrieving the token via /oauth/token the refresh token is somehow passed without a value...
Can anyone tell me if I'm right and if the problem I explained above is related to Doorkeeper or to the gtm-oauth2 library?
My intuition tells me that it's very likely that the problem comes form Doorkeeper...
I have a Ruby on Rails app that uses Doorkeeper to turn it into an OAuth 2.0 provider. Now I am creating an iPhone client for the application which uses the gtm-oauth2 library. The library has the following method to check for the refresh token and authentication token:
As you can see, the method checks if the refresh token is nil. The condition is never met because, as it turns out,
self.refreshTokenis actually[NSNull null]. With the refresh token flow disabled on the server, theself.refreshTokenin the code above should benilnot[NSNull null]. That made me believe that when retrieving the token via/oauth/tokenthe refresh token is somehow passed without a value...Can anyone tell me if I'm right and if the problem I explained above is related to Doorkeeper or to the gtm-oauth2 library?
My intuition tells me that it's very likely that the problem comes form Doorkeeper...