MoEngageJwtAuthenticationDetails

@objc
public class MoEngageJwtAuthenticationDetails : MoEngageAuthenticationDetails

JWT authentication details containing token and user identifier

This class encapsulates JWT authentication information required for MoEngage SDK authentication. It contains the JWT token and associated user identifier.

Usage Example

let jwtDetails = MoEngageJwtAuthenticationDetails(
    token: "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
    identifier: "user123"
)

MoEngageSDKCore.sharedInstance.passAuthenticationDetails(jwtDetails)

JWT Token Requirements

  • The token should be a valid JWT (JSON Web Token)
  • It should be signed with a supported algorithm
  • The token should contain the required claims for MoEngage authentication
  • The token should not be expired

Thread Safety

This class is immutable after initialization and is thread-safe.

Objective-C Compatibility

This class is fully compatible with Objective-C through the @objc annotation.

  • The JWT token string

    This should be a valid JWT token that will be used for authentication with MoEngage services. The token should be properly signed and contain all required claims.

    Declaration

    Swift

    public let token: String
  • The user identifier associated with the token

    This identifier should match the user identifier used in the JWT token’s subject claim. It’s used to associate the authentication with a specific user.

    Declaration

    Swift

    public let identifier: String
  • Initialize JWT authentication details

    Creates a new instance of JWT authentication details with the provided token and user identifier.

    Note

    Both parameters are required and should not be empty strings. The SDK will validate these values when processing the authentication.

    Declaration

    Swift

    @objc
    public init(token: String, identifier: String)

    Parameters

    token

    The JWT token string. Must not be empty.

    identifier

    The user identifier associated with the token. Must not be empty.

  • Returns a string representation of the JWT authentication details

    The token is masked for security purposes, showing only the first few characters.

    Declaration

    Swift

    public override var description: String { get }

    Return Value

    A string description of the authentication details

  • Returns a debug string representation of the JWT authentication details

    Similar to description but with additional debug information.

    Declaration

    Swift

    public override var debugDescription: String { get }

    Return Value

    A detailed string description for debugging