Skip to content

Add oauthServerUrl field to LocalAppAuth#405

Merged
mesilov merged 1 commit intov3-devfrom
feature/385-add-oauth-server-to-local-app-auth
Mar 26, 2026
Merged

Add oauthServerUrl field to LocalAppAuth#405
mesilov merged 1 commit intov3-devfrom
feature/385-add-oauth-server-to-local-app-auth

Conversation

@mesilov
Copy link
Copy Markdown
Collaborator

@mesilov mesilov commented Mar 26, 2026

Q A
Bug fix? no
New feature? yes
Deprecations? no
Issues Fix #385
License MIT

LocalAppAuth stores authentication data for local apps. When a Bitrix24 event or placement request
arrives, the raw auth payload contains server_endpoint — the OAuth server URL that issued the token
(e.g. oauth.bitrix24.tech for east, oauth.bitrix.info for west).

Previously LocalAppAuth did not store this URL, so any consumer reconstructing Credentials
from a saved LocalAppAuth had to hard-code or guess the OAuth server via DefaultOAuthServerUrl::default(),
which breaks multi-region deployments.

Changes:

  • Added oauthServerUrl: string constructor parameter to LocalAppAuth
  • Added getOAuthServerUrl(): string getter
  • toArray() serialises it as oauth_server_url
  • initFromArray() reads oauth_server_url with a fallback to DefaultOAuthServerUrl::default() for backward compatibility with files written by older SDK versions
  • Added unit tests covering constructor, getter, round-trip, backward-compat fallback, and data-provider variants (east / west / custom)

Test plan

  • make lint-cs-fixer — passed
  • make lint-rector — passed (auto-fix applied: variable rename by Rector)
  • make lint-phpstan — passed
  • make lint-deptrac — passed (0 violations)
  • make test-unit — passed (661 tests, 1136 assertions)

Closes #385

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mesilov mesilov added this to the 3.1.0 milestone Mar 26, 2026
@mesilov mesilov self-assigned this Mar 26, 2026
@mesilov mesilov linked an issue Mar 26, 2026 that may be closed by this pull request
@mesilov mesilov merged commit 40b1418 into v3-dev Mar 26, 2026
10 checks passed
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.

[Feature in SDK]: add current oauth server to LocalAppAuth

1 participant