Laravel Passport

Source Code

Usage

auth: {
  strategies: {
    'laravelPassport': {
      provider: 'laravel/passport',
      endpoints: {
        userInfo: '...'
      },
      url: '...',
      clientId: '...',
      clientSecret: '...'
    },
  }
}

Anywhere in your application logic:

this.$auth.loginWith('laravelPassport')

💁 This provider is based on oauth2 scheme and supports all scheme options.

Obtaining url, clientId and clientSecret

These options are REQUIRED. The url is the location of your Laravel application. To obtain the client_id and client_secret, create a new client app in your Laravel app.

User endpoint

userInfo endpoint is used to make requests using axios to fetch user data.

Token Lifetimes

By default, Passport issues long-lived access tokens that expire after one year. If you change their lifetime, don't forget to update token max age and refresh token max age.

Edit this page on GitHub Updated at Sun, Aug 4, 2024