Skip to content

fix(notifier): add OAuth2 token to namf-callback outbound calls; fix SCTP EBADF teardown#202

Merged
Alonza0314 merged 6 commits into
free5gc:mainfrom
solar224:fix/amf-oauth2-callback-token
May 22, 2026
Merged

fix(notifier): add OAuth2 token to namf-callback outbound calls; fix SCTP EBADF teardown#202
Alonza0314 merged 6 commits into
free5gc:mainfrom
solar224:fix/amf-oauth2-callback-token

Conversation

@solar224
Copy link
Copy Markdown
Contributor

Problem

  • AMF sent namf-callback notifications (N1/N2 transfer failure, N1 message notify, UE context transfer) using context.Background(), bypassing OAuth2. Receiving NFs rejected the requests with 401.
  • SCTP teardown incorrectly called HandleConnectionError twice when the file descriptor was already closed (EBADF), producing spurious error logs.

Changes

  • notifier/n1n2message.go, notifier/subscription.go, notifier/ue_context.go: replace context.Background() with GetTokenCtx("namf-callback", <target NF type>) for all outbound callback calls
  • server.go: register namf-callback route group
  • pkg/factory/config.go: add namf-callback to ServiceNameList validator
  • pkg/service/init.go: service init adjustments
  • ngap/service/service.go: add case syscall.EBADF → debug log + return, preventing double error handling

@solar224 solar224 force-pushed the fix/amf-oauth2-callback-token branch from 9815808 to e01241a Compare March 12, 2026 18:37
@Alonza0314 Alonza0314 merged commit aa086fc into free5gc:main May 22, 2026
3 checks passed
@solar224 solar224 deleted the fix/amf-oauth2-callback-token branch May 25, 2026 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants