大麦康布布/oauth-examples

此包的最新版本(v1.0.0)没有提供许可信息。

Daisycon oAuth 示例列表。

v1.0.0 2023-03-03 12:36 UTC

This package is not auto-updated.

Last update: 2024-09-28 19:42:11 UTC


README

此存储库包含用于 oAuth 使用的示例脚本。

JavaScript/TypeScript

注意:JavaScript 和 TypeScript 示例假设您使用 webpack 等编译器。

我们还提供带有 CLI 支持的 oAuth 客户端包https://github.com/DaisyconBV/js-oauth-client

PHP

尽管您可以看到我们的示例,但我们建议您使用 PHP League oAuth 客户端 https://github.com/thephpleague/oauth2-client

对于 CLI,有一个 CLI 客户端可用。

使用方法

php PHP/cli-client.php --clientId CLIENT_ID --clientSecret CLIENT_SECRET --outputFile tokens.json

然后您可以在代码中使用这些令牌,并使用自己的代码刷新它们

PowerShell

这是一个在 PowerShell 中使用 OAuth 进行 API 调用的简单示例。

Install-module -name PKCE
Install-Module -name JWTDetails
Add-Type -AssemblyName System.Web

使用方法

.\PowerShell\example.ps1