PublicClientApplication.createSingleAccountPublicClientApplication Method

Definition

Overloads

createSingleAccountPublicClientApplication( @NonNull final Context context, @Nullable final File configFile)

PublicClientApplication#createSingleAccountPublicClientApplication(Context, int) will read the client id and other configuration settings from the file included in your applications resources.

This function will pass back an MsalClientException object if it is unable to return ISingleAccountApplicationCreatedListener. For example, AccountMode in configuration is not set to single.

Note: The Context should be the application context instead of the running activity's context, which could potentially make the sdk hold a strong reference to the activity, thus preventing correct garbage collection and causing bugs.

For more information on the schema of the MSAL configuration file, please see Android app resource overview and MSAL Github Wiki

createSingleAccountPublicClientApplication( @NonNull final Context context, final int configFileResourceId)

PublicClientApplication#createSingleAccountPublicClientApplication(Context, int) will read the client id and other configuration settings from the file included in your application's resources.

This function will pass back an MsalClientException object if it is unable to return ISingleAccountApplicationCreatedListener. For example, AccountMode in configuration is not set to single.

Note: The Context should be the application context instead of the running activity's context, which could potentially make the sdk hold a strong reference to the activity, thus preventing correct garbage collection and causing bugs.

For more information on the schema of the MSAL config json, please see Android app resource overview and MSAL Github Wiki

createSingleAccountPublicClientApplication(@NonNull final Context context, @NonNull final File configFile, @NonNull final ISingleAccountApplicationCreatedListener listener)

PublicClientApplication#createSingleAccountPublicClientApplication(Context, int, ISingleAccountApplicationCreatedListener) will read the client id and other configuration settings from the file included in your application resources.

This function will pass back an MsalClientException object if it is unable to return ISingleAccountApplicationCreatedListener. For example, AccountMode in configuration is not set to single.

Note: The Context should be the application context instead of the running activity's context, which could potentially make the sdk hold a strong reference to the activity, thus preventing correct garbage collection and causing bugs.

For more information on the schema of the MSAL configuration file, please see Android app resource overview and MSAL Github Wiki

createSingleAccountPublicClientApplication(@NonNull final Context context, final int configFileResourceId, @NonNull final ISingleAccountApplicationCreatedListener listener)

PublicClientApplication#createSingleAccountPublicClientApplication(Context, int, ISingleAccountApplicationCreatedListener) will read the client id and other configuration settings from the file included in your application's resources.

This function will pass back an MsalClientException object if it is unable to return ISingleAccountApplicationCreatedListener. For example, AccountMode in configuration is not set to single.

Note: The Context should be the application context instead of the running activity's context, which could potentially make the sdk hold a strong reference to the activity, thus preventing correct garbage collection and causing bugs.

For more information on the schema of the MSAL config json, please see Android app resource overview and MSAL Github Wiki

createSingleAccountPublicClientApplication( @NonNull final Context context, @Nullable final File configFile)

PublicClientApplication#createSingleAccountPublicClientApplication(Context, int) will read the client id and other configuration settings from the file included in your applications resources.

This function will pass back an MsalClientException object if it is unable to return ISingleAccountApplicationCreatedListener. For example, AccountMode in configuration is not set to single.

Note: The Context should be the application context instead of the running activity's context, which could potentially make the sdk hold a strong reference to the activity, thus preventing correct garbage collection and causing bugs.

For more information on the schema of the MSAL configuration file, please see Android app resource overview and MSAL Github Wiki

public static ISingleAccountPublicClientApplication createSingleAccountPublicClientApplication( @NonNull final Context context, @Nullable final File configFile)

Parameters

context
@NonNull final Context

Application's Context. The sdk requires the application context to be passed in PublicClientApplication. Cannot be null.

configFile
@Nullable final File

The file containing the JSON configuration for the PublicClientApplication. Cannot be null.

Returns

An instance of ISingleAccountPublicClientApplication.

Exceptions

IllegalStateException

if this function is invoked on the main thread.

createSingleAccountPublicClientApplication( @NonNull final Context context, final int configFileResourceId)

PublicClientApplication#createSingleAccountPublicClientApplication(Context, int) will read the client id and other configuration settings from the file included in your application's resources.

This function will pass back an MsalClientException object if it is unable to return ISingleAccountApplicationCreatedListener. For example, AccountMode in configuration is not set to single.

Note: The Context should be the application context instead of the running activity's context, which could potentially make the sdk hold a strong reference to the activity, thus preventing correct garbage collection and causing bugs.

For more information on the schema of the MSAL config json, please see Android app resource overview and MSAL Github Wiki

public static ISingleAccountPublicClientApplication createSingleAccountPublicClientApplication( @NonNull final Context context, final int configFileResourceId)

Parameters

context
@NonNull final Context

Application's Context. The sdk requires the application context to be passed in PublicClientApplication. Cannot be null.

configFileResourceId
final int

The resource ID of the raw file containing the JSON configuration for the PublicClientApplication.

Returns

An instance of ISingleAccountPublicClientApplication.

Exceptions

IllegalStateException

if this function is invoked on the main thread.

createSingleAccountPublicClientApplication(@NonNull final Context context, @NonNull final File configFile, @NonNull final ISingleAccountApplicationCreatedListener listener)

PublicClientApplication#createSingleAccountPublicClientApplication(Context, int, ISingleAccountApplicationCreatedListener) will read the client id and other configuration settings from the file included in your application resources.

This function will pass back an MsalClientException object if it is unable to return ISingleAccountApplicationCreatedListener. For example, AccountMode in configuration is not set to single.

Note: The Context should be the application context instead of the running activity's context, which could potentially make the sdk hold a strong reference to the activity, thus preventing correct garbage collection and causing bugs.

For more information on the schema of the MSAL configuration file, please see Android app resource overview and MSAL Github Wiki

public static void createSingleAccountPublicClientApplication(@NonNull final Context context, @NonNull final File configFile, @NonNull final ISingleAccountApplicationCreatedListener listener)

Parameters

context
@NonNull final Context

Application's Context. The sdk requires the application context to be passed in PublicClientApplication. Cannot be null.

configFile
@NonNull final File

The file containing the JSON configuration for the PublicClientApplication. Cannot be null.

listener
@NonNull final IPublicClientApplication.ISingleAccountApplicationCreatedListener

a callback to be invoked when the object is successfully created. Cannot be null.

createSingleAccountPublicClientApplication(@NonNull final Context context, final int configFileResourceId, @NonNull final ISingleAccountApplicationCreatedListener listener)

PublicClientApplication#createSingleAccountPublicClientApplication(Context, int, ISingleAccountApplicationCreatedListener) will read the client id and other configuration settings from the file included in your application's resources.

This function will pass back an MsalClientException object if it is unable to return ISingleAccountApplicationCreatedListener. For example, AccountMode in configuration is not set to single.

Note: The Context should be the application context instead of the running activity's context, which could potentially make the sdk hold a strong reference to the activity, thus preventing correct garbage collection and causing bugs.

For more information on the schema of the MSAL config json, please see Android app resource overview and MSAL Github Wiki

public static void createSingleAccountPublicClientApplication(@NonNull final Context context, final int configFileResourceId, @NonNull final ISingleAccountApplicationCreatedListener listener)

Parameters

context
@NonNull final Context

Application's Context. The sdk requires the application context to be passed in PublicClientApplication. Cannot be null.

configFileResourceId
final int

The resource ID of the raw file containing the JSON configuration for the PublicClientApplication.

listener
@NonNull final IPublicClientApplication.ISingleAccountApplicationCreatedListener

a callback to be invoked when the object is successfully created. Cannot be null.

Applies to