0

I have seen the tutorial for starting the cloud functions and creating a guestbook on IBM Cloud, but when trying to connect an App ID it actually requires an application and not a Cloud Functions API.

So how can I connect them? Is there some tutorial somewhere? What needs to be considered?

data_henrik
  • 16,724
  • 2
  • 28
  • 49
palamunder
  • 2,555
  • 1
  • 19
  • 20

2 Answers2

0

depending on what you want to do, take a look in https://console.bluemix.net/docs/services/appid/relatedlinks.html#secure. Specifically one of

  • Securing your Cloud Functions API
  • Securing your serverless Cloud Functions mobile backend with App ID
  • Tutorial: GitHub traffic analytics with Cloud Functions and Cloud Foundry
  • Securing your Cloud Functions API - only this is really what I am looking for, but it is outdated and doesn't work the same way anymore – palamunder Nov 05 '18 at 06:15
0

Cloud Functions supports OAuth 2.0 user authorization out of the box and you can bound your App ID instance directly to it.

Here's a fairly recent tutorial showing the steps:

https://www.ibm.com/cloud/blog/authenticating-users-with-cloud-functions-api-gateway-and-app-id


If you're looking to automatically initiate a new authentication flow as in redirect to the an identity provider where you're user will sign in, you'll have to either add logic to your application using an OIDC SDK (For instance App ID's: https://github.com/ibm-cloud-security/appid-serversdk-nodejs/) or add it manually handle the flow from a set of actions.

If you go the action approach, you'll have to keep in mind that they are ephemeral and can't keep session state, so you'll have to keep secure cookies in the user's browser.