Description: The article is about acs login. This is a brief introduction on how to use the ACS. The author shows how to do the user login by using ACS From an application. We will get some additional data regarding the current valid user.
I have shown you how to create the users on the accelerator cloud service so that they can get authenticated and they can get access to your application. I have already created the application, I have already shown you that. I have created one user for development purpose, you can find that.
I have added a user, the user name is test user. Let’s go to the application demo, let us see how to login for this user. I have already created the project to save our time. This is my view. I have a window. That contains the text and the username. It also has the password. You will find a button to login. You can click on the button, the user will get authenticated on the cloud, they will get access to next section.
We will return other user details for this current user. Before going to the code section, let’s see some styles that I have added for these texts. I have added the stifled window, I have changed the background color, I have changed the wide and the layout. I changed it to vertical.
You can see all the components on the window, they should come one after another. I have made it vertical. The text field is text username, this is the style for the username. You can see the weight and height. They can appear in a good look. That is the username field. That is password mark. It will hide the text.
I have already shown you that. There is an event associated with the login button. That should be defined on the controller. This is the view index.XML. Their names should be matched. I have already defined the function. I have created a variable number. I have already added it.
You can create the project. One of those checkboxes is checked with that. Lyou can create the application, you have the provision to check. One check box will enable the cloud service with your application. Due to that reason, this module gets integrated.
That module within a variable is called cloud. This cloud module has some functions called users.login. It will authenticate the user to see if he is a valid user. The cloud service is useful. I am creating two parameters. They will contain the username for login and the password.
It contains the password. It will return. It will be a success. We can have other data sending back from the cloud service. I have shown it for the user. I tried to login to the application, let’s save it, I am going to run the application on the simulator.
You can see the application catalog. You can see the username and the password. You can click the button to login. It is showing some errors on individual. Let’s move to the code line. I have left this value, I am going to save it. I am going to run it again, let’s click the username. I have created it as a test user. The password is test user.
I didn’t add the user name on the circuit cloud, let’s check it. I am going to get back into the application. It will return the user first name. We have been successfully logged in. It returns the data for the current user. It is displaying the first name.