We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
See this log from a client that is requesting a token request from an authUrl and then submitting that token request to Ably.
authUrl
Instanced with an authUrl:
2017-07-19 10:36:19.017043+0700 Integration[1908:810219] DEBUG: (ARTAuth.m:85) RS:0x1c42c7690 validating <ARTClientOptions: 0x1c41cf870> - key: (null); token: (null); authUrl: http://c704750f.ngrok.io/api/v1/broadcasts/1/ably_token; authMethod: GET; hasAuthCallback: 0; clientId: 696;
Token request is requested from authUrl:
2017-07-19 10:36:21.666527+0700 Integration[1908:811289] DEBUG: GET http://c704750f.ngrok.io/api/v1/broadcasts/1/ably_token?clientId=696&ttl=3600.000000&capability=%7B%22*%22:%5B%22*%22%5D%7D×tamp=1500435379.044694&format=msgpack: statusCode 200 ... 2017-07-19 10:36:21.672963+0700 Integration[1908:811289] DEBUG: RS:0x1c42c7690 ARTAuth: authUrl response <NSHTTPURLResponse: 0x1c0438ce0> { URL: http://c704750f.ngrok.io/api/v1/broadcasts/1/ably_token?clientId=696&ttl=3600.000000&capability=%7B%22*%22:%5B%22*%22%5D%7D×tamp=1500435379.044694&format=msgpack } { status code: 200, headers { ... } 2017-07-19 10:36:21.710460+0700 Integration[1908:811289] DEBUG: RS:0x1c42c7690 ARTJsonLikeEncoder<json> decoding '<7b226b65 794e616d 65223a22 65575933 41412e36 6f6a4343 67222c22 74696d65 7374616d 70223a31 35303034 33353338 31323832 2c226e6f 6e636522 3a223638 66663762 61306361 66353332 64346336 33343762 63613732 38653632 6230222c 22636c69 656e7449 64223a22 36393622 2c226361 70616269 6c697479 223a227b 5c222a5c 223a5b5c 222a5c22 5d7d222c 226d6163 223a2270 41765743 55486176 396c6b72 68385179 33724668 65726146 50556c58 6d666e4f 62674e46 4d354d42 65303d22 7d>'; got: { capability = "{\"*\":[\"*\"]}"; clientId = 696; keyName = "eWY3AA.6ojCCg"; mac = "pAvWCUHav9lkrh8Qy3rFheraFPUlXmfnObgNFM5MBe0="; nonce = 68ff7ba0caf532d4c6347bca728e62b0; timestamp = 1500435381282; }
Note that no TTL is specified at this point which is completely valid. clientId and ttl are optional
clientId
ttl
Then when the token request body is sent to Ably, it has a TTL attribute invalidating the Mac:
2017-07-19 10:36:21.727699+0700 Integration[1908:811289] VERBOSE: RS:0x1c42c7690 ARTJsonLikeEncoder<msgpack>: tokenRequestToDictionary ARTTokenRequest: keyName=eWY3AA.6ojCCg clientId=696 nonce=68ff7ba0caf532d4c6347bca728e62b0 mac=pAvWCUHav9lkrh8Qy3rFheraFPUlXmfnObgNFM5MBe0= ttl=3600.000000 capability={"*":["*"]} timestamp=2017-07-19 03:36:21 +0000 2017-07-19 10:36:21.732747+0700 Integration[1908:811289] DEBUG: RS:0x1c42c7690 ARTJsonLikeEncoder<msgpack> encoding '{ capability = "{\"*\":[\"*\"]}"; clientId = 696; keyName = "eWY3AA.6ojCCg"; mac = "pAvWCUHav9lkrh8Qy3rFheraFPUlXmfnObgNFM5MBe0="; nonce = 68ff7ba0caf532d4c6347bca728e62b0; timestamp = 1500435381282; ttl = 3600000; }'; got: <87a36d61 63d92c70 41765743 55486176 396c6b72 68385179 33724668 65726146 50556c58 6d666e4f 62674e46 4d354d42 65303da8 636c6965 6e744964 a3363936 a374746c ce0036ee 80aa6361 70616269 6c697479 ab7b222a 223a5b22 2a225d7d a76b6579 4e616d65 ad655759 3341412e 366f6a43 4367a974 696d6573 74616d70 cf000001 5d58eafc 22a56e6f 6e6365d9 20363866 66376261 30636166 35333264 34633633 34376263 61373238 65363262 30> 2017-07-19 10:36:21.737875+0700 Integration[1908:811289] DEBUG: (ARTRest.m:242) RS:0x1c42c7690 executing request <NSMutableURLRequest: 0x1c000fb70> { URL: https://rest.ably.io:443/keys/eWY3AA.6ojCCg/requestToken?format=msgpack } 2017-07-19 10:36:21.742113+0700 Integration[1908:811289] DEBUG: POST https://rest.ably.io:443/keys/eWY3AA.6ojCCg/requestToken?format=msgpack 2017-07-19 10:36:21.748706+0700 Integration[1908:811289] VERBOSE: Headers { Accept = "application/json,application/x-msgpack"; "Content-Type" = "application/x-msgpack"; "X-Ably-Lib" = "ios-1.0.6"; "X-Ably-Version" = "1.0"; } 2017-07-19 10:36:22.739594+0700 Integration[1908:811022] DEBUG: POST https://rest.ably.io:443/keys/eWY3AA.6ojCCg/requestToken?format=msgpack: statusCode 401 2017-07-19 10:36:22.745444+0700 Integration[1908:811022] VERBOSE: Headers { "Access-Control-Allow-Credentials" = true; "Access-Control-Allow-Origin" = "*"; "Access-Control-Expose-Headers" = "Link,Transfer-Encoding,Content-Length,X-Ably-ErrorCode,X-Ably-ErrorMessage,X-Ably-ServerId,Server"; "Content-Length" = 168; "Content-Type" = "application/json"; Date = "Wed, 19 Jul 2017 03:36:22 GMT"; Vary = Origin; "X-Ably-Errorcode" = 40101; "X-Ably-Errormessage" = "Request mac does not match"; "X-Ably-Serverid" = "frontend.308f.1.ap-southeast-1-A.i-05d672c40b022dd8a"; } 2017-07-19 10:36:22.778802+0700 Integration[1908:811022] WARN: Request mac does not match 2017-07-19 10:36:22.784723+0700 Integration[1908:811022] DEBUG: RS:0x1c42c7690 ARTJsonLikeEncoder<json> decoding '<7b0a0922 6572726f 72223a20 7b0a0909 22737461 74757343 6f646522 3a203430 312c0a09 0922636f 6465223a 20343031 30312c0a 0909226d 65737361 6765223a 20225265 71756573 74206d61 6320646f 6573206e 6f74206d 61746368 222c0a09 09227365 72766572 4964223a 20226672 6f6e7465 6e642e33 3038662e 312e6170 2d736f75 74686561 73742d31 2d412e69 2d303564 36373263 34306230 32326464 3861220a 097d0a7d>'; got: { error = { code = 40101; message = "Request mac does not match"; serverId = "frontend.308f.1.ap-southeast-1-A.i-05d672c40b022dd8a"; statusCode = 401; }; }
The text was updated successfully, but these errors were encountered:
Default token TTL to nil, not 60*60.
2319249
Fixes #618.
Default token TTL to nil, not 60*60. (#619)
d4f6461
tcard
No branches or pull requests
See this log from a client that is requesting a token request from an
authUrl
and then submitting that token request to Ably.Instanced with an
authUrl
:Token request is requested from
authUrl
:Note that no TTL is specified at this point which is completely valid.
clientId
andttl
are optionalThen when the token request body is sent to Ably, it has a TTL attribute invalidating the Mac:
The text was updated successfully, but these errors were encountered: