Skip to content

Handling Authentication in Flutter Application Using PayloadCMS #7853

Answered by andershermansen
iamyahia asked this question in Q&A
Discussion options

You must be logged in to vote
  1. Yes.

You can use the REST API to communicate between the app and Payload CMs. There is a REST API to do the login. See the REST API documentation at: https://payloadcms.com/docs/rest-api/overview

When you call the login API you get a token and the user object back, which will also contain the roles. You can then adjust the functionality in you app accordingly.

For further API calls towards Payload CMS you include the access token as a Authorization Bearer in the HTTP header.

It's important that you implement Access control within you Payload CMS properly so that the actual user roles are enforced on backend side when doing API calls. If not other users without the proper role could call…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by iamyahia
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants