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

When making a call, if we get 401, we should handle it same way as 407 and provide credentials #90

Open
ocarriles opened this issue Feb 20, 2017 · 12 comments
Assignees

Comments

@ocarriles
Copy link

Registration deals with 401/407 responses in order to re-authenticate

Invites just deal with 407.

My use case is returning 401 Unauthorized

@atsakiridis
Copy link
Collaborator

@ocarriles can you elaborate more on your scenario? You are using webrtcomm sdk to make a call and the server returns 401? What happens then, the call fails?

@ocarriles
Copy link
Author

@atsakiridis
Call fails.
Adding also 401 return status to INVITE processing solves my issue, just like it is done in the REGISTER code space.

@atsakiridis
Copy link
Collaborator

@ocarriles, great, so you patched webrtcomm to handle 401 like a 407 for the INVITE, right? Would you like to contribute that back to the codebase? Seems the right thing to do

@ocarriles
Copy link
Author

@atsakiridis , yep, but as I do not want to pollute your code, I am wondering if the this use-case is RFC compliant, Perharphs the SBC has to deal with 401 and convert to 407 in same cases. :)

@atsakiridis
Copy link
Collaborator

I see your point actually it's a little foggy on how the client should handle the following responses from server which seem relevant:

  • 401 Unauthorized
  • 403 Forbidden
  • 407 Proxy Authentication Required

So far I think we 're mostly answering with auth information to 407. In my mind 403 is more like an auth error that doesn't solicit further client requests. But I think we could answer to 401 as well in the same manner

@deruelle what do you think?

@deruelle
Copy link
Member

@atsakiridis right. Let's handle it for 401 in a similar way than for 407. Please note 401 and 407 doesn't use the same header name (Authentication vs Proxy-Authenticate SIP Header IIRC)

@atsakiridis
Copy link
Collaborator

Great, in that case, @ocarriles can you create a Pull Request with your changes, so that we can review and move it forward?

Also, from wikipedia the header names are as I pasted above: 401 Unauthorized and 407 Proxy Authentication Required.

@atsakiridis
Copy link
Collaborator

Hello @ocarriles do you think you 'll be able to create the Pull Request with your solution?

@atsakiridis
Copy link
Collaborator

@ocarriles I'm lost a bit. Why are you editing sbc code and not webrtcomm code? Aren't the changes you suggest webrtcomm ones?

Also you can do a Pull Request that is easier both for you to generate and for us to merge. Do you think you can do that?

@ocarriles
Copy link
Author

@atsakiridis
I am the SBC author.
As the RestComm/sbc injects a proof of concept webrtc client dependecy, I decided to bundle my own webrtcomm code.
Hope it helps.

@atsakiridis
Copy link
Collaborator

I see. Thanks @ocarriles will try to fix the webrtcomm code so that when inviting if we get 401, we handle it same way as 407.

Let me also update the title to make a little bit more explanatory

@atsakiridis atsakiridis changed the title Authenticated INVITES When making a call, if we get 401, we should handle it same way as 407 and provide credentials Apr 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants