Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ashleywnj's avatar

Authenticating a native mobile client using Spark APIs

I am using Spark to develop a web app and would also like to use enable a native iOS app to use the same resources for subscription, authentication and some additional api access.

I can return data via an api by enabling the API Token, however, the token is generated at a user level.

I haven't been able to find any examples - so then switched to trying Auth0 (which is really cool)

But running into issues with Auth0 too - I have included the Auth0 package and can hit the Auth0 authorization form (i.e I can launch the widget and on the Auth0 side it shows a successful verification), but cannot use it to authorize access within the Laravel Spark application - I think it may be due to namespacing issues, but haven't figured it out.

Any guidance appreciated - thinking of just going back to straight Laravel app, use the Auth0 guide https://auth0.com/docs/quickstart/webapp/laravel and then add cashier.

Any recommendations or links to learning resources appreciated.

0 likes
6 replies
ashleywnj's avatar
ashleywnj
OP
Best Answer
Level 2

I figured out how to modify the Spark / Auth0 setup to accomplish what I needed - will write-up and share - hopefully it will help others, but also hoping that more experienced Laravel / PHP devs can help me improve what I did - will finish the write up and post to Medium and then link here in the next two days

ncpope's avatar

Did you create the write up on this yet?

jhc333's avatar

I would also love to see your writeup.

bencarlson's avatar

Any word on this? I'm looking to authenticate a Flutter app with Spark. Thanks!

-Ben

eekayonline's avatar

Hey Guys, for a native (Xamarin) mobile app MVP that I'm working that will use subscriptions (thus Spark) I was wondering how to get API access going.

I found this Gist (thanks Daniel Shields) that shows the steps of integrating Passport with Spark: Passport integration in Spark Gist

Didn't try it yet but it lays out all the necessary steps neatly.

Please or to participate in this conversation.