Category : oauth-2.0

I’m developing a Laravel rest API that uses Google Datastore as the Database server. Now I need to implement a token-based authentication for users stored in Google Datastore entity called Users. But still couldn’t find a better solution or guide. Initially, I tried with JWT-Auth and then studied Laravel Sanctum and Laravel Passport. But no ..

Read more

Hi im gettin this error by making the http request on /oauth/authorize?$query {"error":"unsupported_grant_type","error_description":"The authorization grant type is not supported by the authorization server.","hint":"Check that all required parameters have been provided","message":"The authorization grant type is not supported by the authorization server."} Request: Route::get(‘/login’, function(Request $request) { $request->session()->put(‘state’, $state = Str::random(40)); $query = http_build_query([ ‘id’ => ‘9324f642-bd8a-4923-b2ad-a5b0d559424c’, ..

Read more

I have a laravel application which uses the outlook calendar, recently i started getting the following error: invalid_grant {"userId":2,"exception":"[object] (LeagueOAuth2ClientProviderExceptionIdentityProviderException(code: 0): invalid_grant at /home/admin365a/app.365agenda.nl/vendor/league/oauth2-client/src/Provider/GenericProvider.php:222) I get this error when requesting an accesstoken: $oauthClient = new GenericProvider([ ‘clientId’ => env(‘OAUTH_APP_ID’), ‘clientSecret’ => env(‘OAUTH_APP_PASSWORD’), ‘redirectUri’ => env(‘OAUTH_REDIRECT_URI’), ‘urlAuthorize’ => env(‘OAUTH_AUTHORITY’).env(‘OAUTH_AUTHORIZE_ENDPOINT’), ‘urlAccessToken’ => env(‘OAUTH_AUTHORITY’).env(‘OAUTH_TOKEN_ENDPOINT’), ‘urlResourceOwnerDetails’ => ”, ‘scopes’ ..

Read more

I am implementing passport OAuth 2.0 to main server and hitting from client server to get token but it is giving always unauthorized. Route::get(‘/redirect’, function () { $query = http_build_query([ ‘client_id’ => ‘R4uLMRJEOkfmKjhwZo7qioSv55Z7hJIqQfcXZngE’, ‘redirect_uri’ => ‘http://127.0.0.1:8080/api/callback’, ‘response_type’ => ‘code’, ‘scope’ => ”, ]); die(‘http://127.0.0.1:8000/oauth/authorize?’.$query); return redirect(‘http://127.0.0.1:8000/oauth/authorize?’.$query); }); Route::get(‘/callback’, function (IlluminateHttpRequest $request) { die("response"); }); Source: ..

Read more

I am working on laravel passport authentication. My laravel version is 6.0 and passport version is 8.0 User.php use LaravelPassportHasApiTokens; use SpatiePermissionTraitsHasRoles; class User extends Authenticatable { use Notifiable, HasApiTokens, HasRoles; } config/app.php LaravelPassportPassportServiceProvider::class, authServiceProvider.php use LaravelPassportPassport; use CarbonCarbon; class AuthServiceProvider extends ServiceProvider { /** * The policy mappings for the application. * * @var ..

Read more

I am working in two apps: accounts.domain.com (Laravel app) and dash.domain.com (Not laravel, but php). I want dash users to login through accounts to use the app, so I figured I could use OAuth to achieve this. I installed Laravel Passport and everything worked fine when getting an authorization code: $query = http_build_query([ ‘client_id’ => ..

Read more