-
Notifications
You must be signed in to change notification settings - Fork 26
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
Client manage token requests #30
Conversation
- 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.
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 : @"*"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@paddybyers Correct?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
@paddybyers Please merge when it's possible. Sorry for the long change. It was really necessary because the Both authentication methods are stable now. |
Client manage token requests
Thanks |
RAS7a1
andRAS7a2
are failing. Will check that on the next PR.