Skip to content

DPoP proof JWT on API calls (without nonce)#4060

Draft
sfdctaka wants to merge 6 commits into
forcedotcom:dpopfrom
sfdctaka:feature/dpopApiCalls
Draft

DPoP proof JWT on API calls (without nonce)#4060
sfdctaka wants to merge 6 commits into
forcedotcom:dpopfrom
sfdctaka:feature/dpopApiCalls

Conversation

@sfdctaka

Copy link
Copy Markdown
Contributor

This PR adds a new public, ObjC-visible property to SFOAuthCredentials:
@property (nonatomic, readonly, nullable) NSString *tokenType;

Why: the OAuth token endpoint (RFC 6749 §5.1) returns a token_type field — "Bearer" or "DPoP" — which determines the Authorization scheme the SDK must use on subsequent authenticated requests. The DPoP rollout requires the SDK to read this value, persist it across launches, and gate scheme selection on it. Existing tokenFormat is a Salesforce-specific field ("jwt"/"opaque") and is not the right signal.

Storage and lifecycle: tokenType is encoded/decoded in NSCoder, copied in copyWithZone:, cleared on revokeRefreshToken, and parsed in updateCredentials: from the token_type response key. It mirrors tokenFormat exactly.

Consumers: read-only externally; populated only by the SDK's own token-endpoint response parser. Apps and ISVs do not need to set it.

Backward compatibility: purely additive. No existing API changes, no behavior change for non-DPoP orgs (Bearer remains
the default and is byte-identical to pre-DPoP output — verified by a regression snapshot test).

@wmathurin wmathurin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

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.

3 participants