Answer the question
In order to leave comments, you need to log in
Is it possible to use OAuth on the client side?
Good day. I am writing an application partially working on the browser side. Yii2 and AngularJS are used. On the server side, I implemented the possibility of authorization through OAuth with the Yii AuthClients extension.
Please tell me how to implement access to the services API on the browser side? As far as I understand, you need to implement a proxy from your service and from the browser make a request to your server and from my server make a request to external APIs
Answer the question
In order to leave comments, you need to log in
Yes. but not necessarily a "proxy" - any form of your own API over the functionality of your application, the
main thing is that it would be clear to you as a developer - what the application asks your server; and on the server - how the server can get this from a third-party API
, the action does not have to be the same on the server and on the client, on the contrary - encapsulation of the implementation of a typical action in one place, this is the best approach to architecture
(there is only one alternative - to study the protocol at the implementation level of extensions like AuthClients , then theoretically you can use the same tokens both on your server and in the client part in the browser)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question