Summer Sale! All accounts are 50% off this week.

fylzero's avatar
Level 67

Is it possible to login with Sanctum programmatically?

I'm working with a legacy SSO system that authenticates to a service then redirects to Laravel (currently using Laravel/UI scaffolding) and logs the user in that is passed from the auth service.

Now the goal is to build an SPA and I'm wondering if this same pattern would be possible for Sanctum SPA auth. I'm not sure if this is possible and/or secure for that matter?

I'm imagining instead of using redirects, the SPA would have to call the auth service, auth, then Guzzle the auth token from the app and return that as a response in the same way Sanctum does.

If anyone has any thoughts, other suggestions, or just thinks I'm way off base, please let me know.

Additional Note: Since this app will not be a monolith - the SPA will be a separate VueCLI app, I need to do this with Sanctum API auth or the Mobile auth pattern.

0 likes
0 replies

Please or to participate in this conversation.