Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation issue: Incorrect KindeClientSDK Initialization #26

Open
3 tasks done
0ctan33 opened this issue Feb 24, 2024 · 1 comment
Open
3 tasks done

Documentation issue: Incorrect KindeClientSDK Initialization #26

0ctan33 opened this issue Feb 24, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@0ctan33
Copy link
Contributor

0ctan33 commented Feb 24, 2024

Prerequisites

How can we improve the docs or what is missing?

Hello!

The PHP SDK docs have this string to initialize Kinde
$this->kindeClient = new KindeClientSDK("KINDE_HOST", "KINDE_REDIRECT_URL", "KINDE_CLIENT_ID", "KINDE_CLIENT_SECRET", "KINDE_GRANT_TYPE");

however this no longer appears to work as the KINDE_POST_LOGOUT_REDIRECT_URL parameter is also required but not specified anywhere in the docs.

Additionally the environment variables for configuration make no mention of the required KINDE_GRANT_TYPE.

I think it would be good to document exactly what parameters KindeClientSDK accepts and what is required during the "Configure your app" part of the SDK docs.

Provide extra context, such as what you were trying to do and your requirements

I was trying to use Kinde for the first time and ran into many issues due to improper & outdated documentation

If the docs page already exists, please provide a link

https://kinde.com/docs/developer-tools/php-sdk/#configure-your-app

@0ctan33 0ctan33 added the documentation Improvements or additions to documentation label Feb 24, 2024
@daemkl
Copy link

daemkl commented Dec 18, 2024

10 months later and the documentation is still outdated. The PHP SDK is broken and initialization is throwing errors due to incorrect grant types:

2024/12/18 23:04:37 [error] 3389474#3389474: *549658 FastCGI sent in stderr: "PHP message: Failed to login: 
Please provide correct grant_type" while reading response header from upstream, client: 127.0.0.1, server: _, 
request: "GET /kinde/login HTTP/2.0", upstream: "fastcgi://unix:/run/php/php8.2-fpm.sock:", host: "localhost"

Documentation states:

  1. $this->kindeClient = new KindeClientSDK("KINDE_HOST", "KINDE_REDIRECT_URL", "KINDE_CLIENT_ID", "KINDE_CLIENT_SECRET", "KINDE_GRANT_TYPE");
  2. $this->kindeClient = new KindeClientSDK("KINDE_HOST", "KINDE_REDIRECT_URL", "KINDE_CLIENT_ID", "KINDE_GRANT_TYPE", "KINDE_CLIENT_SECRET");
  3. $this->kindeClient = new KindeClientSDK("KINDE_HOST", "KINDE_REDIRECT_URL", "KINDE_CLIENT_ID", GrantType::authorizationCode:, "KINDE_CLIENT_SECRET");
  4. $this->kindeClient = new KindeClientSDK("KINDE_HOST", "KINDE_REDIRECT_URL", "KINDE_CLIENT_ID", GrantType::authorizationCode, "KINDE_CLIENT_SECRET");
  5. $this->kindeClient = new KindeClientSDK("KINDE_HOST", "KINDE_REDIRECT_URL", "KINDE_CLIENT_ID", "KINDE_CLIENT_SECRET", "KINDE_POST_LOGOUT_REDIRECT_URL", "profile email offline openid");
  6. $this->kindeClient = new KindeClientSDK("KINDE_HOST", "KINDE_REDIRECT_URL", "KINDE_CLIENT_ID", "KINDE_CLIENT_SECRET", "KINDE_POST_LOGOUT_REDIRECT_URL", "authorization_code");
  7. $this->kindeClient = new KindeClientSDK("KINDE_HOST", "KINDE_REDIRECT_URL", "KINDE_CLIENT_ID", "KINDE_CLIENT_SECRET", "authorization_code", "KINDE_POST_LOGOUT_REDIRECT_URL");
  8. and multiple other combinations ...

The ONLY combination that works, as of now (kinde-oss/kinde-auth-php version 2.0.1) is:

$kindescope = 'authorization_code'; // exactly as written, do not replace with 'profile email offline openid'
$this->kindeClient = new KindeClientSDK(
  "KINDE_HOST",
  "KINDE_REDIRECT_URL",
  "KINDE_CLIENT_ID",
  "KINDE_CLIENT_SECRET",
  $kindescope,
  "KINDE_POST_LOGOUT_REDIRECT_URL"
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants