-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Labels
bugSomething isn't working. It's clear that this does need to be fixed.Something isn't working. It's clear that this does need to be fixed.
Description
Steps to reproduce:
- Setup an endpoint to use as an
auth_urland have the auth_url require authentication. Return aTokenRequestvia the endpoint withauth.create_token_request - Setup an AblyRealtime instance to use
auth_urlandauth_headersin its client options
Expected Result:
The authorization header is used to authenticate the client to the auth_url and the subsequent request from the client to get a token from the request token endpoint is successful.
As per the spec item TO3j8 and Ably docs the headers should be used in requests to the auth_url which implies that they shouldn't be sent in the token request to Ably.
Including an authorization header in authHeaders in ably-js for this scenario works
Actual result:
The request is rejected by realtime and the client goes to the disconnected state
ConnectionManager.on_error_from_authorize(): err = 40144 401 Unexpected error decoding Ably token or JWT; the token is not valid
ConnectionManager.on_error_from_authorize: Client configured authentication provider request failed
ConnectionManager.notify_state(): new state: ConnectionState.DISCONNECTED
Workarounds:
- Return a JWT or Ably token to the client which wont require a request to the request token endpoint
- Use
auth_callbackinstead ofauth_url
Metadata
Metadata
Assignees
Labels
bugSomething isn't working. It's clear that this does need to be fixed.Something isn't working. It's clear that this does need to be fixed.