Skip to content

Unexpected login/logout Behaviour #3

@tobyf93

Description

@tobyf93

I've currently setup the following methods to test out the library:

...
const extraQueryParameters = 'domain_hint=mydomain.com.au';
const validateAuthority = false;
const useBroker = false;
const authority = 'https://login.windows.net/common';
const resourceUri = 'https://graph.windows.net';

login = async () => {
  try {
    await AzureAdal.configure(
      authority,
      validateAuthority,
      clientId,
      redirectUri,
      useBroker,
    );

    const userDetails = await AzureAdal.login(resourceUri, '', extraQueryParameters);
    console.log('userDetails', userDetails);
  } catch (error) {
    console.log('login error', error);
  }
}

getToken = async () => {
  try {
    await AzureAdal.configure(
      authority,
      validateAuthority,
      clientId,
      redirectUri,
      useBroker,
    );

    const userDetails = await AzureAdal.getTokenAsync(resourceUri);
    console.log('userDetails', userDetails);
  } catch (error) {
    console.log('getToken error', error);
  }
}

logout = async () => {
  try {
    await AzureAdal.configure(
      authority,
      validateAuthority,
      clientId,
      redirectUri,
      useBroker,
    );

    const loggedOut = await AzureAdal.logout();
    console.log('loggedOut', loggedOut);
  } catch (error) {
    console.log('logout error', error);
  }
}

Expected Behaviour

  1. login() prompts the user for credentials and returns user details.
  2. getToken() returns user details by accessing the IOS keychain.
  3. logout() returns true.
  4. getToken() is unable to retrieve user details from the keychain.
  5. login() prompts user for credentials again.

Actual behaviour

  1. "
  2. "
  3. "
  4. "
  5. Login() does not prompt user again for credentials and returns user details.

I'm very confused as to how this is happening. Is there a chance that the token is being cached in the webviews cookies and not being cleared by logout()?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions