I am buiding an app using svelteKit and django rest framework. SvelteKit is responsible for rendering HTML page(SSR) and django rest framework is responsible for providing restful API.
Both App server and browser will fetch
my restful API. I want protect my restful api by add Authorization. After reading some documents, I plan to use OAuth2(django-oauth2-tookit) and I draw the following chart:
But I was confused by following problems:
- I can use
Authorization Code
grant flow auth APP server, but how about the browser? - Can I separate the auth server and restful server, If so, how auth server protect restful server?