Skip to content

Interface is terrible! You should never use interfaces to inter-activity comunnication #2333

@SelvinPL

Description

@SelvinPL

In the example you are using AcquireTokenFragment it has acquireTokenCallback which is passed MsalWrapper which wrapps it with AuthenticationCallback

This is very bad code practice in android development - you are leaking fragment which MAY BE DEAD after code from this library (MAY AND WILL BE DEAD - if you enable "Don't keep activities" - and callback will be called on not atached dead fragment/activity)

Proper flow should be using Activity/Fragment.startActivityForResult/registerForActivityResult for IPublicClientApplication.acquireToken and ISingleAccountPublicClientApplication.signIn (and other functions which starts new activity)

It is ok for acquireTokenSilent to use callback since it doesn't start new activity

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions