Базовая версия клиента авторизации по протоколу OAuth2

This commit is contained in:
Andrey Pokidov
2020-02-27 13:10:22 +07:00
commit 12b74a2bf1
86 changed files with 8992 additions and 0 deletions

21
public/.htaccess Normal file
View File

@@ -0,0 +1,21 @@
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>

14
public/1.php Normal file
View File

@@ -0,0 +1,14 @@
<?php
$secret = 'v3Oi3425I83g3x1rNqQ45l43sM9z4Xj3Q2e92q9b';
$jwt = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIzIiwianRpIjoiNGQxOGY3NzRkZjQxYTBjZTYyMjIzMDRhN2E5NmFkMTkyZDA5ODBlNDMwZDQxZDZkMjhjMjAwZjkwOTNkODgwMjViMTU4NDNiNTViMTU5ZmQiLCJpYXQiOjE1ODI2MTcwODIsIm5iZiI6MTU4MjYxNzA4MiwiZXhwIjoxNjE0MjM5NDgxLCJzdWIiOiIxIiwic2NvcGVzIjpbXX0.OdKZ05R3QIf1meId6DW8qIRRMB_Irh8feiv6synP0vldOi62FMfTFLPCe1J2UafjU9zT2JZZhQC-9mIuObDvUZB8znYnaCeTgu_XwuzNz41ICm8duDeVDv_tR_mQHA3kzu_-qJ1fhKWTxEIhf1VblMhnvy49hbcSEBOjGp1Wy0rjTcVRBJRZ1QWxG9G8NBsq2ryNyENOhk3VrKPR1CY9Uw7pRw96iuALkeoMNvqH07L7M4zMzYLu1S_eo_wPHCIhru4OlKbPGlBVffykgbhnKD-HGeEJZes8oMUnIUhkDqEUj_taF2-onS-ivRwBFaTlbabk2AgR0XWzbczOCgRJnKxhXeKKOpq5UAjNreB7qgpJHuRsTn1QA_V6Wq7pHELm-Y0UYGathvaSbG3NKXKdyg0Lhaa0YIbOkEp5oria-FqANkTBDAXHOq-t8HKbXOAYYY-OyrPHO-G44lM_agD_SxaI0OAEXCOAMX5pkR2OaBaPbkjz43Cv-h9AcGN4FVlCFLFnSC1IFpFYgKKnUbONAVvPANpgO513YRTnDE2tAmP29suPWSY3vBEwcT5THWPYgFiGRHIwgrY_fEgGH3mDnFQqiEKSKeTBW94rDJ6NPI1YCQ7PnuzYyA25Uro7YhB05SnjVTkhlR-f5HAkXNFjTGjF-hxIkN0I4EoXYSMFz8c';
$jwtParts = explode('.', $jwt);
$header = json_decode(base64_decode($jwtParts[0]));
$payload = json_decode(base64_decode($jwtParts[1]));
$signature = base64_decode($jwtParts[2]);
var_dump($header);
var_dump($payload);
//var_dump($signature == );

0
public/favicon.ico Normal file
View File

60
public/index.php Normal file
View File

@@ -0,0 +1,60 @@
<?php
/**
* Laravel - A PHP Framework For Web Artisans
*
* @package Laravel
* @author Taylor Otwell <taylor@laravel.com>
*/
define('LARAVEL_START', microtime(true));
/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader for
| our application. We just need to utilize it! We'll simply require it
| into the script here so that we don't have to worry about manual
| loading any of our classes later on. It feels great to relax.
|
*/
require __DIR__.'/../vendor/autoload.php';
/*
|--------------------------------------------------------------------------
| Turn On The Lights
|--------------------------------------------------------------------------
|
| We need to illuminate PHP development, so let us turn on the lights.
| This bootstraps the framework and gets it ready for use, then it
| will load up this application so that we can run it and send
| the responses back to the browser and delight our users.
|
*/
$app = require_once __DIR__.'/../bootstrap/app.php';
/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request
| through the kernel, and send the associated response back to
| the client's browser allowing them to enjoy the creative
| and wonderful application we have prepared for them.
|
*/
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
$response->send();
$kernel->terminate($request, $response);

2
public/robots.txt Normal file
View File

@@ -0,0 +1,2 @@
User-agent: *
Disallow:

28
public/web.config Normal file
View File

@@ -0,0 +1,28 @@
<!--
Rewrites requires Microsoft URL Rewrite Module for IIS
Download: https://www.microsoft.com/en-us/download/details.aspx?id=47337
Debug Help: https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/using-failed-request-tracing-to-trace-rewrite-rules
-->
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.*)/$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="/{R:1}" />
</rule>
<rule name="Imported Rule 2" stopProcessing="true">
<match url="^" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>