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

fix: use authctxId to authentication #142

Merged
merged 4 commits into from
Sep 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions internal/sbi/consumer/ausf_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/base64"
"fmt"
"net/url"
"regexp"
"strconv"
"sync"

Expand Down Expand Up @@ -119,9 +120,12 @@ func (s *nausfService) SendAuth5gAkaConfirmRequest(ue *amf_context.AmfUe, resSta
if err != nil {
return nil, nil, err
}
re := regexp.MustCompile("/ue-authentications/.*/")
match := re.FindStringSubmatch(ue.AuthenticationCtx.Links["5g-aka"].Href)
authctxId := match[0][20 : len(match[0])-1]
donald1218 marked this conversation as resolved.
Show resolved Hide resolved

confirmResult, httpResponse, err := client.DefaultApi.UeAuthenticationsAuthCtxId5gAkaConfirmationPut(
ctx, ue.Suci, confirmData)
ctx, authctxId, confirmData)
defer func() {
if httpResponse != nil {
if rspCloseErr := httpResponse.Body.Close(); rspCloseErr != nil {
Expand Down Expand Up @@ -171,7 +175,11 @@ func (s *nausfService) SendEapAuthConfirmRequest(ue *amf_context.AmfUe, eapMsg n
return nil, nil, err
}

eapSession, httpResponse, err := client.DefaultApi.EapAuthMethod(ctx, ue.Suci, eapSessionReq)
re := regexp.MustCompile("/ue-authentications/.*/")
match := re.FindStringSubmatch(ue.AuthenticationCtx.Links["eap-session"].Href)
authctxId := match[0][20 : len(match[0])-1]

eapSession, httpResponse, err := client.DefaultApi.EapAuthMethod(ctx, authctxId, eapSessionReq)
defer func() {
if httpResponse != nil {
if rspCloseErr := httpResponse.Body.Close(); rspCloseErr != nil {
Expand Down
Loading