问题
I am using Jquery Mobile to start with IBM worklight project. I have created a Login Page. Whenever user click on the submit button I need the function too run to check for the username and password in the Database.
Database -> I am using MY SQl database. Using the command client I have added the tables, username Password and values. I need to check this table whenever user clicks on the submit button. IBM worklight tutorial says I need to add the JDBC jar file to server/lib. I have copy pasted the downloaded file on the same folder.
I don`t know whether I need to make my own Custom login Module or default thing is available.
There Isn`t a clear examples available in the IBM website for the Authentication. Please help me with this.
回答1:
I would suggest reading the following:
- Authentication concepts
- Adapter-based authentication + Exercise and code sample
- Adapter framework overview
- SQL adapter – Communicating with SQL database + Exercise and code sample
from the Getting Started page. Also take a look at InfoCenter if you need more documentation.
From the adapter-based auth code sample, you can start by replacing:
if(username == "worklight" && password == "worklight")
with a call to your backend (see sql adapter code sample) that checks if the username and password are valid.
来源:https://stackoverflow.com/questions/18685085/login-authentication-in-ibm-worklight