0
votes

I have WebAPI backend setup with external authentication as described in this post. Most of my Controllers are decorated with the [Authorize] attribute to limit access.

Until now I consumed my API via web browser which worked great, but now I want to consume it via an Ionic 2 mobile app.

All the posts I've found describes solutions that authenticate directly against the social provider but I need to authenticate against my server so I'd have access to the restricted API.

How do I authenticate against my WebAPI server from an Ionic 2 app?

1

1 Answers

0
votes

You need to call the http://localhost:nnnn/api/login/externallogin method and allow the user to authenticate through the third-party service (ie. google) using their credentials.

Once the authorization server (ie. google) has granted access you should be able to make calls against the methods marked with the Authorize attribute.