Use SaaS Authentication Users to accelerate application development

Source: Internet
Author: User

The new generation of cloud services no longer requires application developers to write server-side code. Almost all applications depend on the service logic of the server. The callback is.API provided by PP. Applications rely on servers to analyze, store, communicate, and integrate with existing systems. Although generic services, such as analysis, are generally outsourced to professional service providers, many developers still need to write server-sideCode to support the functions of their applications, especially when you compile enterprise-level applications that need to be integrated with the backend system. Putting configuration and business logic on the server isGood way, so that you can quickly update the content and business rules.

 

For enterprises that have embraced cloud services, there is another option. Emerging service providers make it easier for application developers to develop. YouYou can outsource the basic functions of your business logic to cloud service providers. Imagine the basic architecture of any application that provides services-you need to markTo identify who they are, how to log in, and what they can do. You will have data synchronized between the device and the cloud. You have content to update. You want to integrate social networkingMedia, you must support notifications and communicate with users. You may also need to support in-app payment. You also need to provide location services such as address retrieval. Of courseTransfer content (this makes the first download package of your application very small ).

 

You can write most of the above Code by yourself. Create a traditional N-layer architecture, configure the database, and optimize the load. Write deployment script, Schedule Backup, singleYuan test, overtime, when the server goes down at on the weekend to answer the phone...

 

Infrastructure-as-a-service providers such as Amazon, rackspace, and joyent will save you this part of work. Platform-as-a-service providers such as Heroku can save your work more. But let's ask-do you want to write code? How much business logic can be used by software-as-a-service?
Delivery?

 

Let's take the user ID authentication as an example. You can compare multiple APIs. Although login to social media accounts such as Facebook, Twitter, or LinkedIn can quickly solve this problem, there are also available sdks. If you want to build a deeper relationship with users, this is not a satisfactory solution. You need your own user database. Therefore, you need to write your own server code and support your own verification server.The oauth protocol must be supported. Write new functions for your application. Consider the proper storage location of your password and implement the password prompt page. Let's look at the outsourcedUser Identification website parse.com,
How does stackmob.com or kinvey.com work.

 

To use the parse.com service, you must first register with parse.com and install their android SDK. User Identification FunctionParseuserObject.

 

ParseUser user = new ParseUser();user.setUsername("my name");user.setPassword("my pass");user.setEmail("email@example.com");

 

(Sample code on parse.com)

 

To register a new user, callSignupinbackgroundFunction:

user.signUpInBackground(new SignUpCallback() {  public void done(ParseException e) { … }}

 

User Login, callLogininbackgroundFunction:

 

ParseUser.logInInBackground("Jerry", "showmethemoney", new LogInCallback() {  public void done(ParseUser user, ParseException e) { … }}

 

As you can see, the API uses an anonymous embedded class as the callback, which is similar to the node. js. style. You need to maintain your own user interface, which is not what parse.com can do. But parse.com
You can maintain email verification, password reminder, logon cache, user authorization, and management console to manage user data. You don't need to do this yourself.Yes.

 

To integrate the user data stored in parse.com with the existing system, you need to call its rest API. This API allows you to call all APIs for data over HTTP. This API is critical to avoid locking.The cloud service provider used to query whether the function is provided.

 

Cloud providers make money. You should compare their pricing. Parse.com is free for low-end users. Of course, if your application is popular, you 'd better purchase their services.

 

The services of stackmob.com and parse.com are similar. Stackmob API is closer to the underlying rest
API.

 

final String username = "johndoe";final String password = "mypassword";Map<String, String> args = new HashMap<String, String>();args.put("username", username);args.put("password", password); StackMobCommon.getStackMobInstance().login(args, new StackMobCallback() {  @Override public void success(String responseBody) {    //handle success here  }  @Override public void failure(StackMobException e) {    //handle failure here  }});

 

(Stackmob.com sample code)

 

There is also an anonymous embedded callback mode. This is because these vendors support Java, objective-C, and JavaScript APIs. To make the structure similar, they all work asynchronously and Use callback to tell you that the Code call is over.

 

To use parse.com, you must maintain the user interface by yourself. The stackmob service allows you to integrate rest APIs. If the number of users is small, you can use it for free.

 

Kinvey.com provides similar user management functions. Below are their APIs:

 

 

KinveySettings = KinveySettings.loadFromProperties(getApplicationContext());sharedClient = KCSClient.getInstance(getApplicationContext(), settings); KinveyUser user = service.loginWithUsername("existinguser", "pass");

 

(Kinvey.com sample code)

 

The kinvey.com service also simulates JavaScript callback functions, but provides a more natural Java-style public function layer. You will also get a rest API and a free user volume.

 

Which service do you want to use? Each service provides similar functions-there are no different ways to provide user identification or data storage layer-so the API structure is similar. If these services are valid products, the price may be the deciding factor.

 

However, there is another factor to consider. Most cloud services tend to be the winner. Everyone wants to use reliable and secure suppliers. The rule of the game isSelect the winner. Unfortunately, it is too early. My suggestion: you create an abstraction layer on the API of the selected service. If one of the vendors grows as the leader, it can be quickly converted to that vendor.

    Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.