Digital Developer Conference: a FREE half-day online conference focused on AI & Cloud – North America: Nov 2 – India: Nov 9 – Europe: Nov 14 – Asia Nov 23 Register now

Close outline
  • United States
IBM?
  • Site map
IBM?
  • Marketplace

  • Close
    Search
  • Sign in
    • Sign in
    • Register
  • IBM Navigation
IBM Developer Answers
  • Spaces
    • Blockchain
    • IBM Cloud platform
    • Internet of Things
    • Predictive Analytics
    • Watson
    • See all spaces
  • Tags
  • Users
  • Badges
  • FAQ
  • Help
Close

Name

Community

  • Learn
  • Develop
  • Connect

Discover IBM

  • ConnectMarketplace
  • Products
  • Services
  • Industries
  • Careers
  • Partners
  • Support
10.190.13.195

Refine your search by using the following advanced search options.

Criteria Usage
Questions with keyword1 or keyword2 keyword1 keyword2
Questions with a mandatory word, e.g. keyword2 keyword1 +keyword2
Questions excluding a word, e.g. keyword2 keyword1 -keyword2
Questions with keyword(s) and a specific tag keyword1 [tag1]
Questions with keyword(s) and either of two or more specific tags keyword1 [tag1] [tag2]
To search for all posts by a user or all posts with a specific tag, start typing and choose from the suggestion list. Do not use a plus or minus sign with a tag, e.g., +[tag1].
  • Ask a question

Using StrongLoop and Mobile Client Access to Authenticate Users

31000212YN gravatar image
Question by beezeetim  (16) | Mar 18, 2016 at 11:20 AM node.jsibmcloudbluemix-mobile-servicesstrongloopauthenticated

If you use the Mobile Boilerplate in Bluemix, how can we use Strongloop as a custom authentication backend to integrate with Mobile Client Access? Is there any tutorial or sample code on this?

Dave Cariello

People who like this

  1
Comment
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster

1 reply

  • Sort: 
270007B8PT gravatar image

Answer by Dave Cariello (2901) | Mar 21, 2016 at 09:56 AM

We have a helloTodoAdvanced sample hosted on github that can show you how to do this. We also have an article currently being reviewed, so I will update this thread once that is released.

You'll notice in our Node.js code that we use the MCA Token Validation strategy to protect our node server endpoints.

Once the MCA passport strategy is defined, we can use the line:

passport.authenticate('mca-backend-strategy', {session: false})

to protect any node endpoint, as done on line 46 for delete and line 54 for some custom push notifications.

This ensures that any successful request contains a valid auth header that can only be generated by the mobile SDK. If you configure MCA to require Facebook login, you will need to develop your client side mobile app to require successful Facebook login before making any requests to these protected endpoints or they will fail.

Comment

People who like this

  0   Show 2   Share
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
31000212YN gravatar image beezeetim (16)   Mar 27, 2016 at 11:43 AM 0
Share

Hi Dave, the sample uses facebook for authenticating with the mobile client access. If we use custom authentication using Strongloop, how would that work?

270007B8PT gravatar image Dave Cariello (2901) ♦ beezeetim (16)   Mar 27, 2016 at 09:33 PM 0
Share

@beezeetim, after adding the passport.authenticate... line to your Node.js code, whatever authentication you have configured on your Bluemix MCA tile will be used when your mobile app attempts to hit that endpoint. See Using a custom identity provider to authenticate users to understand how to configure custom auth with your Bluemix MCA tile and your mobile app.

Follow this question

86 people are following this question.

Answers

Answers & comments

Related questions

One Database Per User Design for Cloudant Loopback (NodeJS) IOS mobile 0 Answers

Facebook User details MCA login NodeJS and Mobile 2 Answers

Error: Unknown authentication strategy "imf-resource-strategy" on server for AMA with custom identity provider 1 Answer

iOS App - Can't find "Advanced Mobile Access" Service 1 Answer

StrongLoop loopback deployment failed 0 Answers

  • Contact
  • Privacy
  • IBM Developer Terms of use
  • Accessibility
  • Report Abuse
  • Cookie Preferences

Powered by AnswerHub

Authentication check. Please ignore.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • API Connect
  • Analytic Hybrid Cloud Core
  • Application Performance Management
  • Appsecdev
  • BPM
  • Blockchain
  • Business Transaction Intelligence
  • CAPI
  • CAPI SNAP
  • CICS
  • Cloud Analytics
  • Cloud Automation
  • Cloud Object Storage
  • Cloud marketplace
  • Collaboration
  • Content Services (ECM)
  • Continuous Testing
  • Courses
  • Customer Experience Analytics
  • DB2 LUW
  • Data and AI
  • DataPower
  • Decision Optimization
  • DevOps Build
  • DevOps Services
  • Developers IBM MX
  • Digital Commerce
  • Digital Experience
  • Finance
  • Global Entrepreneur Program
  • Hadoop
  • Hybrid Cloud Core
  • Hyper Protect
  • IBM Cloud platform
  • IBM Design
  • IBM Forms Experience Builder
  • IBM Maximo Developer
  • IBM StoredIQ
  • IBM StoredIQ-Cartridges
  • IIDR
  • ITOA
  • InformationServer
  • Integration Bus
  • Internet of Things
  • Kenexa
  • Linux on Power
  • LinuxONE
  • MDM
  • Mainframe
  • Messaging
  • Node.js
  • ODM
  • Open
  • PartnerWorld Developer Support
  • PowerAI
  • PowerVC
  • Predictive Analytics
  • Product Insights
  • PureData for Analytics
  • Push
  • QRadar App Development
  • Run Book Automation
  • Search Insights
  • Security Core
  • Storage
  • Storage Core
  • Streamsdev
  • Supply Chain Business Network
  • Supply Chain Insights
  • Swift
  • UBX Capture
  • Universal Behavior Exchange
  • UrbanCode
  • WASdev
  • WSRR
  • Watson
  • Watson Campaign Automation
  • Watson Content Hub
  • Watson Marketing Insights
  • dW Answers Help
  • dW Premium
  • developerWorks Sandbox
  • developerWorks Team
  • Watson Health
  • More
  • Tags
  • Questions
  • Users
  • Badges