HTTPS Requests from AngularJS NodeJS

I am a beginner at https and I have developed a certificate and key based express example:

server = https.createServer(https_options, app).listen(PORT, HOST);


where https_options is the above security mechanism. My question is how can I get authenticated from angularjs services / factories when I call the express routes api. For example: routes.js:

app.get('/home', function(req, res) {


angular factory:



A simple example will work for me :) Thanks a lot!


source to share

2 answers

Here is a good article using both Node with Express and AngularJs.

This article uses token based authentication. Authentication isn't done in your Angular app, but it happens in Node, your Angular app just needs to know how to contact your Node API to authenticate users.

With token-based authentication, in this case Json Web Tokens, a token is sent to your API on every request. Your API then authenticates the token and grants or denies access to the user making the request.



Client certificates might be the solution. Authentication will be handled by the web browser prompting the user to select a certificate rather than their own script.

See this article for an example on how to implement this type of authentication:



All Articles