OpenSIPS / opensips

OpenSIPS is a GPL implementation of a multi-functionality SIP Server that targets to deliver a high-level technical solution (performance, security and quality) to be used in professional SIP server platforms.
https://opensips.org
Other
1.23k stars 571 forks source link

[FEATURE] Can uac_auth using realm in challenge instead of specific by user #3428

Open okhowang opened 3 weeks ago

okhowang commented 3 weeks ago

Describe the solution you'd like I'm using uac_auth for authenticate to some other service. the realm parameter is necessary now. I need to set realm in module parameters or AVP. But in the real world, the realm may change even with the same service (by some incorrect setup, maybe).

Implementation

- Component: `uac` - Type: func - Name: `uac_auth` `uac_auth` can got a flag indicate that using realm in UAS 401/407 response instead of specific by user. **Describe alternatives you've considered** there is no func in script which can parse realm from authenticate header. I must use regex to get realm from response header (it looks ugly). **Additional context**
bogdan-iancu commented 3 weeks ago

Shouldn't $ar give you the info you need ?

okhowang commented 3 weeks ago

$ar $ad is for Authorization header which is the part of SIP request. the issue is about how uac_auth handle WWW-Authenticate/Proxy-Authenticate header in SIP response.

bogdan-iancu commented 3 weeks ago

That's correct, indeed. Nevertheless, the grammar for the Authorization and Authentication hdrs looks the same, IMHO

okhowang commented 3 weeks ago

but there is no builtin variable like $ar $ad for WWW-Authenticate/Proxy-Authenticate header in SIP response.

bogdan-iancu commented 2 weeks ago

At least we clarified what we need here :)

okhowang commented 2 weeks ago

How about this

uac_auth can got a flag indicate that using realm in UAS 401/407 response instead of specific by user.

for example

if (t_check_status("401|407") {
    uac_auth("AUTO_REALM");
}
github-actions[bot] commented 4 days ago

Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.