Article
· Nov 10, 2017 1m read

Angular client demo using OAuth2 Authorization Server to protect Caché based resources

As many of you, our partners, are more widely using modern UI frameworks to create client front-end, you may have encountered a question, "So how do I secure my data when I just finished developing all new fancy browser based client experience?"

The answer is easy. Use a standard, proven OAuth2 and OpenID!

"OK, but how can I do it? I have never done it before."

No problem, just have a look here, if your client is Angular (not AngularJS) based, there is a demo project available for you to review and get inspired!

The demo presents a simple Angular (and typescript) application with user login and public/private data REST based retrieval from a server. Please bear in mind that I'm not an angular expert, so my coding might not be the best quality, but the demo is functional (at least on my machine, sigh!)

Hope you'll find it useful! 

Discussion (1)2
Log in or sign up to continue

This looks great Dan. For anyone interested, I put together an example of using OAuth2 in AngularJS in the Widgets Direct demo app here:
https://github.com/intersystems/widgets-direct

It shows sending the requests and getting the access code back, but I haven't included validating that on the server side. If there is interest I can look at adding that.