The Node.js web application demonstrates how to sign in/sign up/sign out a user and reset the user's password with and without an IFrame. In addition, blank.css demonstrates how to customize the forms when using ARTIK Cloud Account as the identity provider.
For more information on this feature, go to our documentation page: https://developer.artik.cloud/documentation/introduction/accounts.html
- Node v0.12.x or above
- Execute the command to install node modules
npm install- Configure your application in the Developer Dashboard as following:
- Set "Redirect URL" to “http://localhost:4444/redirect”.
- Set "AUTHORIZATION METHODS" to "Authorization Code (With Secret)"
- Under "PERMISSIONS", set "Profile" to "Read". You should also set it to "Write" if you want the application to modify the user's profile.
- Set config.json:
- clientId: your application ID (client ID)
- clientSecret: your application Client Secret
- authUrl: ARTIK Cloud Accounts API url (https://accounts.artik.cloud)
- apiUrl: ARTIK Cloud REST API url (https://api.artik.cloud/v1.1)
- host: your server hostname (localhost)
- port: your server port (4444)
- log: log configuration
- testCSS: true, to set Form CSS in test mode. false, to use approved CSS (or default CSS if no CSS approved yet)
- Run the command in the terminal:
node index.js config.json- In your browser, load http://localhost:4444 . Then you will be able to play with sign in/sign up/sign out et al.
- File html/blank.css is an example of form customization. To see the customized pages, set 'testCSS' in config.json to true as mentioned in the Setup / Installation. Navigate to a sign in/sign up/sign out page, and then apply the content of html/blank.css to the local blank.css in your browser. Now you should see the customized page. Consult the browser documentation to learn how to override local blank.css file.
- "localhost:4444/": provide a page where you can sign in with four identity providers (with or without iFrame).
- "localhost:4444/signin": sign in using ARTIK Cloud Account as the identity provider with IFrame. In the form, you can go to "forgot password" and "sign up".
Peek into "Android OAuth starter" in Tutorials for more examples.
If you are not familiar with ARTIK Cloud, we have extensive documentation at https://developer.artik.cloud/documentation
The full ARTIK Cloud API specification can be found at https://developer.artik.cloud/documentation/api-reference/
Peek into advanced sample applications at https://developer.artik.cloud/documentation/samples/
To create and manage your services and devices on ARTIK Cloud, visit the Developer Dashboard at https://developer.artik.cloud
Licensed under the Apache License. See LICENSE.
Copyright (c) 2016 Samsung Electronics Co., Ltd.