Category : oauth-2.0

I am using GuzzleHttpClient for calling api from Laravel application controller. I am using this API to get oauth token in Laravel controller but this api calling is not wroking. eg: My written API is getBearerToken So API url is https://test.domain.com/api/v1/getBearerToken public function getBearerToken(Request $request) { $client = new Client(); $url = ‘https://test.domain.com.’/oauth/token’; $response = ..

Read more

i’m trying to make auth2 authentication with bookingGo address like: https://auth.dispatchapi.taxi.booking.com/oauth2/token and retrieve a token. I have my client_id and secret_key for that, but when i’m making a request i have different errors. First of all i’ve tryed Laravel and GuzzleHttp like thst way: $response = $this->client->request("POST" , "/oauth2/token", [ ‘headers’ => [‘Content-Type’ => ‘application/x-www-form-urlencoded’], ..

Read more

I’m currently reading the documentation on Laravel Passport on skipping the authorization prompt for a first-party client. I have protected routes based on the scopes the clients request which a typical user would authenticate however, I am using Laravel passport as a Single-Sign-On server for my first party applications as well as third party and ..

Read more

I just created a new laravel project where I’ll use passport for auth. My users have UUID and installed passport with the UUID option. things I’ve noticed… passport’s id is a primary string of 100 characters ($table->string(‘id’,100)->primary()) user ID is a unsignedBigIncrement , nullable in some cases and index $table->unsignedBigInteger(‘user_id’)->nullable()->index() Cliend ID, with the –uuid ..

Read more

I am using Laravel Socialite with the Microsoft Oauth provider – https://socialiteproviders.com/Microsoft/#installation-basic-usage and was wondering if I can get more information from the user? If I die and dump the returned OAuth2User I get the following: token refreshToken expiresIn id nickname name email avatar displayName givenName jobTitle and so on. I was wondering if its ..

Read more

So Basically I have two laravel apps. One is used as a server one is used as a client. I have integrated passport and I get an access token like so: {"token_type":"Bearer","expires_in":1296000,"access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxMyIsImp0aSI6IjdmMGZkYmZlNGExMDY5YmYxNTU2MTA4MzRiMjY1NDMxZjFhYzYzM2U0ZGVlNTExMmE5YWQ2YzUyNzVjODkxYzZhZGQ0ZjNiNTFkMjI2NjgxIiwiaWF0IjoxNjMxOTcwMzIxLCJuYmYiOjE2MzE5NzAzMjEsImV4cCI6MTYzMzI2NjMyMSwic3ViIjoiMTEiLCJzY29wZXMiOltdfQ.DpC_sqhxYXLijpTDIq4NfnRm4aDEKzUKwUU4L0ZaVhyJcoUB4j22KURYXG1T3ODJ3g8Js3Ly61ExuRA0yrs-bEDbcNwrFIFoK4YeCYBH7a8SMO6MhRszvXhjyXzCfrAAtheIAkK1GHAU94hksG7IFxx0F8762jqS0Y3qbB7_L5aBHj8GotDP09-83waYU6zmThVBLG3FcVB7OswoeXna8HsxLSryNzVWex1aB1xhaJ6QB2vUryatXeyUUI9YK1Zw4JzazwQUADw2Ip35aTNXhBRsxkHo3o_4Iegqao6KFBqcJI-3wxHyF0d8OafQG5sskLVN55FPOJ2UIbugwh-8G7vOkgtE-42-xnrIxeB9uxM3bNME8JGhZ8Lx4Af4CR6nhmZiUcTCqG73Pw2xHjZJ9WvDssfBzltYKM537g0gJgtlw2G_2pArMrI2AVl0Om7FQD-CSitMj-sDkKmDPNXmYiRdpRDFoAWqfYFG6YlBDjdQu3QNdq_8NLXIliU8iInkXIc8hY2sB5DkolpMtAltHnWe1M3CoiWfuFJpQbVRdK1juzHwfPAFm9Swv2-NdAg4Pz9K6aCisdIJbtayANWUYl9aXvwKDFMaHveU8U4sXGooYbirxJ6S6VUIGAbE127Inr_ZT98WQhWhKxekmSur0rpoat0HOILGJlLtq1xcIUI","refresh_token":"def50200f490beb568a3238567479d5a01e5ad8735144b6a369e686206f4895855259253842f1d58c776078843ac58704499c1477dafd6e979aa8142e4ac673097f99b1991b8aaa1151aa6f181e755c66ab2e4fbe54c576585b6b93fbc4ddd2acdb13abe3c986cbbc67f90779c7179f5eeee30bde0569c90f12eb74682213d1141a70e029f1fa797beae8cc5a133d62e548a2f4c1a760cafee5b5001e8dd1c11869d78e9c5df35ef7f55c1b83a80d740ada6d63208c17f3a6a1f715bb2337cee07f64d89f43d25701266ec9f71d242db07ad0c08786b1423906e9dbfb3259d5dc80b2c989f3333ee21128c510df802271ea6b4485e6513f3029158c662427219424a73103eb94798826a02b41aba5151774eb7382a6bbcbbf3e468cd663b0c7d02a75617a9c39d978a822b156e1b4c052637ee7955344d88d9761b10f2192374d233425c8ce3cf38a01b3fb870f5d9423dbb01a825a02061de5d07ffac667545ade492"} Than from the client using this access token I can make an request to the server app api to /api/user that is identified ..

Read more

I am using fresh install of Laravel 8 and passport to create oauth2 server. To test with the client I use Postman. Following this guide https://laravel.com/docs/8.x/passport#introduction here are all the changes I’ve made: AuthServiceProvider.php: <?php namespace AppProviders; use IlluminateFoundationSupportProvidersAuthServiceProvider as ServiceProvider; use IlluminateSupportFacadesGate; use LaravelPassportPassport; class AuthServiceProvider extends ServiceProvider { /** * The policy mappings ..

Read more

I have been using google/googleapi package to work on google calendar when I request authorization on oauth2.0 I’m getting an error as GuzzleHttpExceptionClientException Client error: `POST https://oauth2.googleapis.com/token` resulted in a `400 Bad Request` response: { "error": "invalid_grant", "error_description": "Bad Request" } I really need to fix this as soon as possible. Here’s my code for ..

Read more

I’m planning on building a small platform like Salonized. Frontend in Nuxt.js, and a separated multi-tenant backend in Laravel for the API’s. I’m not sure what to use to authenticate the users and API calls (Passport/Oauth2, Sanctum?), because of the following: The application will hold salon appointments, and I want to offer the option to ..

Read more

I’m trying to integrate an azure b2c provider with laravel socialite. I already add socialite and additional azure provider from socialiteproviders.com I edited the Provider.php class to change the getAuthUrl schema in order to use tenant instead login.microsoftonline.com and it works fine: The login page shown and redirected then to setup callback. In the callback ..

Read more

i’m new with nuxt and i want to use nuxt auth, this my configuration in nuxt.config.js: auth: { strategies: { local: { token: { property: ‘data.success.data.access_token’, type: ‘Bearer’ }, user: { property: ‘data.success.data.user’, autoFetch: true }, endpoints: { login: {url: process.env.BASE_URL_API + ‘/authentication’, method: ‘post’}, logout: { url: process.env.BASE_URL_API + ‘/_revoke’, method: ‘post’ }, user: ..

Read more

I have a web app whose api endpoints i want to test using Gatling. I have set up the Gatling successfully. I have run the engine successfully against the recorded simulation. A report is generated. However I notice that all the api endpoints in the report return KO meaning they failed. When I log the ..

Read more