Downloadable Asset: 
Developer Guide Documentation: 
Asset Version: 
1.0.1
Asset Description: 
Amway ID supports Refresh Token as a component to integrate anywhere in your app, to refresh the access_token without prompting the login screen every time by using the refresh_token. This component helps developers easy to integrate and refresh the access_token before making any service call and avoids lots of business logic to handle access_token and refresh_token every time.
Details: 

<p>Component documentation fix</p>
<br/><p><strong>1 Overview</strong></p>

<p>Access tokens are short-lived - they normally only work for 1 hour. In order to get a new access token, you use the refresh token. Authorization servers SHOULD issue access tokens with a limited lifetime and require clients to refresh them by requesting a new access token using the same assertion if it is still valid. Otherwise, the client MUST obtain a new valid assertion.</p>

<p>Amway ID supports Refresh Token as a component to integrate anywhere in your app, to refresh the access_token without prompting the login screen every time by using the refresh_token.</p>

<p>This component helps developers easy to integrate and refresh the access_token before making any service call and avoids lots of business logic to handle access_token and refresh_token every time.</p>

<p><strong>2 Getting Started with the&nbsp;AmwayID RefreshToken&nbsp;component</strong></p>

<p>This is a Getting Started section for the&nbsp;AmwayID Refresh Token. It contains information about importing and running the component.</p>

<p>For information about the&nbsp;Dynamic Usage, Properties, Events, and APIs of the component, you can visit the&nbsp;Reference Section.</p>

<p>Before you start using the&nbsp;Amway ID Refresh Token component, make sure that you meet all the requirements in the&nbsp;Prerequisites.</p>

<p><strong>3 Prerequisites</strong></p>

<ul>
<li>A&nbsp;<a href="https://manage.kony.com/">Kony account</a></li>
<li>Kony Visualizer V8 SP4, or higher</li>
<li>Work with&nbsp;a member of the Amway ID team to discuss &amp; determine how long your refresh token should be configured, based upon the criticality of data in your app.</li>
</ul>

<p><strong>3.1 Source Code</strong></p>

<p>The component source can be found at&nbsp;<a href="https://github.com/AmwayACS/AmwayIDNativeLogin">https://github.com/Amway...

<p><strong>4 Importing the Component</strong></p>

<p>Before you start importing the component to Kony Visualizer, you must download the component from the&nbsp;Amway Marketplace&nbsp;website. You can import the marketplace components only into the apps that are of the Kony Reference Architecture type.</p>

<p>To import the AmwayID RefreshToken component, do the following:</p>

<ol>
<li>Open your app project in Kony Visualizer.</li>
<li>On the&nbsp;File&nbsp;menu, point to&nbsp;Import, and click&nbsp;Component to Library. The&nbsp;Open&nbsp;dialog appears.</li>
<li>Navigate to the location where you downloaded the component (zip file) on your computer, select the component, and click&nbsp;Open. After Visualizer downloads the component, it opens a window that asks you to enter the metadata for the component.</li>
</ol>

<p>Enter a&nbsp;Library Name, a&nbsp;Collection Name, and a&nbsp;Description&nbsp;if you require one.</p>

<ul>
<li><strong>Library Name&nbsp;-</strong> A Library contains component collections and skins. The Library Name specifies the library that you want to import the component into. If the library does not exist, Visualizer will create a new one.<br />
As an example, let us name the Library as&nbsp;<strong>AmwayID</strong>.</li>
<li><strong>Collection Name&nbsp;-</strong> A collection contains multiple components. The Collection Name specifies the collection that you want to import the component into. If the collection does not exist in the specified library, Visualizer will create a new one.<br />
As an example, let us name the Collection as&nbsp;<strong>RefreshToken</strong>.</li>
<li><strong>Component Name</strong>&nbsp;- This name specifies the display name you want to use for the component in Visualizer.<br />
By default, the component name is&nbsp;<strong>com.alticor.RefreshToken</strong>.</li>
<li>After you import the component, you can drag and drop it from the Collection Library onto your form.</li>
<li>Save the form now.</li>
</ul>

<p>After you add the component to a form, you need to configure the native settings of your project. You can refer to the following sections for more information.</p>

<p><strong>4.1 Configuring Component Properties</strong></p>

<p>You can use a component's Properties to customize and configure the elements. These elements can be UI elements, service parameters, and so on. For more information about properties, you can refer to the&nbsp;<a href="https://docs.kony.com/konylibrary/visualizer/visualizer_user_guide/Defau... target="_blank">Components Overview</a>&nbsp;section of the Visualizer User Guide.</p>

<p>You can set the properties from the&nbsp;<strong>Properties</strong>&nbsp;panel on the right side of the Visualizer. You can also configure these properties using JavaScript code.</p>

<p><strong>4.2 Setting Properties</strong></p>

<p><strong>Login Tokens</strong></p>

<p><strong>Description:</strong></p>

<p>Login success response object which we have received in the login success callback.</p>

<p><strong>Syntax:</strong>&nbsp;loginResponse</p>

<p><strong>Type:</strong>&nbsp;String</p>

<p><strong>Read/Write:</strong>&nbsp;Write</p>

<p><strong>Example:</strong></p>

<p>this.view.RefreshToken.loginResponse = response;</p>

<p><strong>Identity Service Name</strong></p>

<p><strong>Description:</strong></p>

<p>The Identity service name which we have defined in MF App.</p>

<p><strong>Syntax:</strong>&nbsp;identityServiceID</p>

<p><strong>Type:</strong>&nbsp;String</p>

<p><strong>Read/Write:</strong>&nbsp;Write</p>

<p><strong>Example:</strong></p>

<p>this.view.RefreshToken.identityServiceID = "QAAmwayIDAuthService";</p>

<p><strong>Loading Indicator Skin</strong></p>

<p><strong>Description:</strong></p>

<p>Loading Indicator Skin to match with app loading indicator skin.</p>

<p><strong>Syntax:</strong>&nbsp;loadingIndSkin</p>

<p><strong>Type:</strong>&nbsp;String</p>

<p><strong>Read/Write:</strong>&nbsp;Write</p>

<p><strong>Example:</strong></p>

<p>this.view.RefreshToken.loadingIndSkin = "sknLoadingIndicator";</p>

<p><strong>4.3&nbsp;<a href="javascript:void(0);">Building and Running your app</a></strong></p>

<p>After performing all the above steps, you can perform either of the following tasks:</p>

<p>Build and Publish your app&nbsp;(Visualizer Enterprise)</p>

<p>For more information, you can refer to the&nbsp;<a href="http://docs.kony.com/konylibrary/visualizer/visualizer_user_guide/Defaul... target="_blank">Building and Viewing an Application</a>&nbsp;section of the Visualizer User Guide.</p>

<p><strong>5 APIs</strong></p>

<p><strong>5.1 RefreshToken Events</strong></p>

<p><strong>5.1.1 getRefreshToken</strong></p>

<p><strong>Description:</strong></p>

<p>API method to refresh the access_token using refresh_token.</p>

<p><strong>Syntax:</strong>&nbsp;getRefreshToken()</p>

<p><strong>Parameters:</strong>&nbsp;None.</p>

<p><strong>Return Value:</strong>&nbsp;None.</p>

<p><strong>Example:</strong></p>

<p>this.view.RefreshToken.getRefreshToken();</p>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ex: this.view.btnRefreshToken.onClick = this.onClickRefreshToken;</p>

<p>onClickRefreshToken : function(){</p>

<p>&nbsp;&nbsp;&nbsp; this.view.RefreshToken.getRefreshToken();</p>

<p>&nbsp; },</p>

<p><strong>5.1.2 refreshTokenCallback</strong></p>

<p><strong>Description:</strong></p>

<p>Its RefreshToken success callback event to define business logic</p>

<p><strong>Syntax:</strong>&nbsp;refreshTokenCallback()</p>

<p><strong>Parameters:</strong>&nbsp;response.</p>

<p><strong>Return Value:</strong>&nbsp;None.</p>

<p><strong>Example:</strong></p>

<p>this.view.RefreshToken.refreshTokenCallback = this.refreshTokenCallback;</p>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ex: refreshTokenCallback : function(response){</p>

<p>&nbsp;&nbsp;&nbsp; this.view.lblAccessToken.text = response.access_token;</p>

<p>&nbsp;&nbsp;&nbsp; this.view.lblIDTokenValue.text = response.id_token;</p>

<p>&nbsp; },</p>

<p><strong>5.1.3 errorMessageCallback</strong></p>

<p><strong>Description:</strong></p>

<p>Its RefreshToken Failure callback event to define business logic.</p>

<p><strong>Syntax:</strong>&nbsp;errorMessageCallback()</p>

<p><strong>Parameters:</strong>&nbsp;message.</p>

<p><strong>Return Value:</strong>&nbsp;None.</p>

<p><strong>Example:</strong></p>

<p>this.view.RefreshToken.errorMessageCallback = this.errorMessageCallback;</p>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ex: errorMessageCallback : function(message){</p>

<p>&nbsp;&nbsp;&nbsp; this.view.lblErrorDesc.text = message;</p>

<p>&nbsp;&nbsp;&nbsp; this.view.flxErrorMain.isVisible = true;</p>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },</p>

<p><strong>6 External Links</strong></p>

<p>Please find the <strong>Confluence</strong> link <a href="https://jira.amway.com:8444/display/GIW/Refresh+Token+Component">here</a...

Supported App Types: 
Supported Devices: 
Supported Platforms: 
Platform Version: 
Asset Requirements: 
Visualizer Enterprise
MobileFabric
Status: 
Approved
Title Approved: 
Title Review: 
Body Approved: 
Body Review: 
Asset Display View Approved: 
Asset Display View Review: 
Detail View Images/Video Approved: 
Detail View Images/Video Review: 
Developers Guide Documentation Approved: 
Developers Guide Documentation Review: 
Additional Notes: 
Asset Review Status: 
Approved
Use iPhone Wrapper: 
Use iFrame: 
Item Guid: 
c0e7f7479288430e9821c19b8b284bfe
Item Kuid: 
u4af4b26c567465eac90c48276399eec
Is NFI: