Skip to content

Conversation

svycka
Copy link
Contributor

@svycka svycka commented Jan 24, 2020

public function loginWithCredentials(string $usernameOrEmail, string $password)
{
    $I = $this;
    ​
    $I->amHttpAuthenticated('android', '');
    $I->sendPOST('/oauth2/token', [
        'username' => $usernameOrEmail,
        'password' => $password,
        'grant_type' => 'password',
    ]);
    $accessToken = $I->grabDataFromResponseByJsonPath('$.access_token');
    // I would like to remove HTTP auth here but there is no way how to do it now
    // but now I will be able to reset server params with $I->setServerParameters([]);
    $I->amBearerAuthenticated($accessToken[0]);
    $I->sendPOST('/user-profile');
}

@svycka svycka requested a review from Naktibalda January 24, 2020 08:32
@Naktibalda Naktibalda merged commit 0b0c03e into Codeception:master Jan 24, 2020
@svycka svycka deleted the patch-1 branch January 24, 2020 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants