microsoft / microsoft/kiota-php

Missing options in oauth provider

Open
#27 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
8
Forks
10
Avg merge
10h 16m
Merged PRs (30d)
3

Description

ClientId, ClientSecret and additional parameters are not persisted in oauth provider https://github.com/microsoft/kiota-authentication-phpleague-php/blob/dev/src/Oauth/ProviderFactory.php#L32

Consider the following example

$tenantId = '';
$clientId = '';
$clientSecret = '';

$clientCredentials = new ClientCredentialContext($tenantId, $clientId, $clientSecret);

$accessTokenProvider = new PhpLeagueAccessTokenProvider($clientCredentials);
$accessTokenProvider->getOauthProvider()->authorize(); 
Details

Result: The request body must contain the following parameter: 'client_id'.
https://login.microsoftonline.com/{$tenantId}/oauth2/v2.0/authorize?state=randomstring&response_type=code&approval_prompt=auto

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/Oauth/ProviderFactory.php around line 32 and reproduce the issue with the ClientCredentialContext and PhpLeagueAccessTokenProvider example. Trace how the OAuth provider is created and verify that client_id, client_secret, and additional parameters are retained so the authorization request includes the required client_id.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
authentication
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.