Class DittoAuthenticationProvider
Represents a string-based authentication provider identifier used for login with Ditto.
Important: This API is in preview and provides a type-safe struct for specifying authentication providers, using the extensible-enum pattern. Supports both built-in and custom providers in a consistent and ergonomic way in v5.
This class defines built-in providers such as development(), and also allows defining
custom providers by passing an arbitrary string to custom(String).
Custom providers can be defined as follows:
`DittoAuthenticationProvider provider = DittoAuthenticationProvider.custom("my-custom-provider");ditto.auth().login(token, provider);`
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull DittoAuthenticationProviderCreates a custom authentication provider with the specified identifier.static @NonNull DittoAuthenticationProviderReturns the built-in development authentication provider.final booleaninthashCode()toString()
-
Method Details
-
development
Returns the built-in development authentication provider.
This provider is used for development and testing purposes. It should not be used in production environments as it provides unrestricted access.
- Returns:
- the development authentication provider.
-
custom
Creates a custom authentication provider with the specified identifier.
This allows you to use custom authentication providers beyond the built-in ones. The raw value should match the provider identifier configured in your Ditto Big Peer or authentication system.
- Parameters:
rawValue- the custom provider identifier string.- Returns:
- a custom authentication provider with the specified identifier.
-
toString
-
hashCode
-
equals
-