Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client manage token requests #30

Merged
merged 4 commits into from
Oct 20, 2015
Merged

Client manage token requests #30

merged 4 commits into from
Oct 20, 2015

Conversation

ricardopereira
Copy link
Contributor

  • Auth.authorise was missing the possibility of receiving just an access token.
  • Auth.options.clientId can be nil.
  • Sign TokenRequest with clientId=* when the user is anonymous.
  • Rest.calculateAuthorization was missing the Auth.authorise for token reusability.

⚠️
RAS7a1 and RAS7a2 are failing. Will check that on the next PR.

 - Auth.authorise was missing the possibility of receiving just an access token.
 - Auth.options.clientId can be nil.
 - Sign TokenRequest with clientId=* when the user is anonymous.
 - Rest.calculateAuthorization was missing the Auth.authorise for token reusability.
@ricardopereira
Copy link
Contributor Author

Second merge!

@@ -143,7 +145,7 @@ - (ARTAuthTokenRequest *)sign:(NSString *)key {
NSString *keyName = keyComponents[0];
NSString *keySecret = keyComponents[1];
NSString *nonce = generateNonce();
NSString *clientId = self.clientId ? self.clientId : @"";
NSString *clientId = self.clientId ? self.clientId : @"*";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@paddybyers Correct?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@paddybyers Correct?

No, I don't think so. A TokenRequest only contains the wildcard clientId if explicitly requested by the caller.

If the caller does not specify a clientId, and the Ably library was not initialised with a clientId, then the token request does not contain any clientId. For the purposes of canonicalisation, if there is no clientId then an empty string is used in place of the clientId to construct the canonical text.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. The authentication is working.

The problem:
 - The Auth.authorise was requesting a new token with authMethod=Token.

Now, the request has 3 possibilities:
 - AuthorizationOn
 - AuthorizationOff
 - AuthorizationUseBasic
@ricardopereira
Copy link
Contributor Author

@paddybyers Please merge when it's possible.

Sorry for the long change. It was really necessary because the Auth.authorise wasn't handling the authentication well.

Both authentication methods are stable now.
I think it's a good opportunity to work on the RealtimeClient considering that it's a high priority.

paddybyers added a commit that referenced this pull request Oct 20, 2015
@paddybyers paddybyers merged commit 8973990 into ably:master Oct 20, 2015
@paddybyers
Copy link
Member

Thanks

@ricardopereira ricardopereira deleted the auth-method-token-revision branch October 20, 2015 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants