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

[Feature] RFC 8898 support #2669

Closed
gkapkowski opened this issue Mar 10, 2021 · 4 comments
Closed

[Feature] RFC 8898 support #2669

gkapkowski opened this issue Mar 10, 2021 · 4 comments

Comments

@gkapkowski
Copy link

Description

Hi, is there anyone working on adding support for RFC 8898 and do you know of any clients that already implement it or are working towards supporting it?

How could I go about starting such effort?

RFC 8898

Third-Party Token-Based Authentication and Authorization for Session
Initiation Protocol (SIP)

Abstract

This document defines the "Bearer" authentication scheme for the
Session Initiation Protocol (SIP) and a mechanism by which user
authentication and SIP registration authorization is delegated to a
third party, using the OAuth 2.0 framework and OpenID Connect Core
1.0. This document updates RFC 3261 to provide guidance on how a SIP
User Agent Client (UAC) responds to a SIP 401/407 response that
contains multiple WWW-Authenticate/Proxy-Authenticate header fields.

...

@miconda
Copy link
Member

miconda commented Mar 11, 2021

Personally I do not work on such extensions, others devs can comment if they plan to work on it.

If you want to develop it, the recommended way is to try to make a new module if is going to have dependencies on external libraries. If no external dependencies, and not significant changes to the existing code, then can eventually plugged in the auth module.

@grumvalski
Copy link
Contributor

grumvalski commented Mar 12, 2021

Hi,
actually you can implement RFC 8898 in kamailio routing script, all the pieces are already there.
For the challenge you can easily reply 401/407 adding a "forged" WWW-Authenticate header with Bearer schema and authz_server.
For the token validation:

  • if it's a structured token you can validate the JWT and extract the claims using the jwt module and jansson module
  • if it's a reference token you can call the /inspect endpoint using http_client or http_async_client modules and parse the response with jansson module

Basically all the RFC is here, being the claims and how they apply to the routing logic strictly domain/business logic dependent.
A dedicated module would just wrap the token validation and challenge logics into some functions exposed to kemi/script.
I've though about this for some time but at the end I didn't start for lack of time and because the implemenation I've done using routing script is fullfilling our needs and running in production since several years.
But it would be probably nice to have :)
About the client, I'm not aware of any client actively working on implementing it, in my case I'm using a modified Linphone client for android/iOS.

@miconda
Copy link
Member

miconda commented Mar 12, 2021

@grumvalski: thanks for these useful details and good to know it was already possible to implement it. I got a similar feeling that should be doable by blending several modules/functions in native config/kemi when I quickly looked over the specs. Not spending time to look at details, I let it open for further discussions, and as you said it too, if someone wants to add it, it would be nice to have and welcome to do it.

@miconda
Copy link
Member

miconda commented May 3, 2021

Closing, being possible with script operations based on the comments above. If someone wants to make a C implementation, then just make a PR.

@miconda miconda closed this as completed May 3, 2021
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