Skip to content

Commit

Permalink
fix: use authctxId to auth not ue.suci
Browse files Browse the repository at this point in the history
  • Loading branch information
donald1218 committed Sep 12, 2024
1 parent 299aeb9 commit 84cdc71
Showing 1 changed file with 10 additions and 2 deletions.
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]

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

0 comments on commit 84cdc71

Please sign in to comment.