<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 AmwayID RefreshToken component</strong></p>
<p>This is a Getting Started section for the AmwayID Refresh Token. It contains information about importing and running the component.</p>
<p>For information about the Dynamic Usage, Properties, Events, and APIs of the component, you can visit the Reference Section.</p>
<p>Before you start using the Amway ID Refresh Token component, make sure that you meet all the requirements in the Prerequisites.</p>
<p><strong>3 Prerequisites</strong></p>
<ul>
<li>A <a href="https://manage.kony.com/">Kony account</a></li>
<li>Kony Visualizer V8 SP4, or higher</li>
<li>Work with a member of the Amway ID team to discuss & 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 <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 Amway Marketplace 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 File menu, point to Import, and click Component to Library. The Open dialog appears.</li>
<li>Navigate to the location where you downloaded the component (zip file) on your computer, select the component, and click 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 Library Name, a Collection Name, and a Description if you require one.</p>
<ul>
<li><strong>Library Name -</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 <strong>AmwayID</strong>.</li>
<li><strong>Collection Name -</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 <strong>RefreshToken</strong>.</li>
<li><strong>Component Name</strong> - This name specifies the display name you want to use for the component in Visualizer.<br />
By default, the component name is <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 <a href="https://docs.kony.com/konylibrary/visualizer/visualizer_user_guide/Defau... target="_blank">Components Overview</a> section of the Visualizer User Guide.</p>
<p>You can set the properties from the <strong>Properties</strong> 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> loginResponse</p>
<p><strong>Type:</strong> String</p>
<p><strong>Read/Write:</strong> 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> identityServiceID</p>
<p><strong>Type:</strong> String</p>
<p><strong>Read/Write:</strong> 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> loadingIndSkin</p>
<p><strong>Type:</strong> String</p>
<p><strong>Read/Write:</strong> Write</p>
<p><strong>Example:</strong></p>
<p>this.view.RefreshToken.loadingIndSkin = "sknLoadingIndicator";</p>
<p><strong>4.3 <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 (Visualizer Enterprise)</p>
<p>For more information, you can refer to the <a href="http://docs.kony.com/konylibrary/visualizer/visualizer_user_guide/Defaul... target="_blank">Building and Viewing an Application</a> 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> getRefreshToken()</p>
<p><strong>Parameters:</strong> None.</p>
<p><strong>Return Value:</strong> None.</p>
<p><strong>Example:</strong></p>
<p>this.view.RefreshToken.getRefreshToken();</p>
<p> Ex: this.view.btnRefreshToken.onClick = this.onClickRefreshToken;</p>
<p>onClickRefreshToken : function(){</p>
<p> this.view.RefreshToken.getRefreshToken();</p>
<p> },</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> refreshTokenCallback()</p>
<p><strong>Parameters:</strong> response.</p>
<p><strong>Return Value:</strong> None.</p>
<p><strong>Example:</strong></p>
<p>this.view.RefreshToken.refreshTokenCallback = this.refreshTokenCallback;</p>
<p> Ex: refreshTokenCallback : function(response){</p>
<p> this.view.lblAccessToken.text = response.access_token;</p>
<p> this.view.lblIDTokenValue.text = response.id_token;</p>
<p> },</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> errorMessageCallback()</p>
<p><strong>Parameters:</strong> message.</p>
<p><strong>Return Value:</strong> None.</p>
<p><strong>Example:</strong></p>
<p>this.view.RefreshToken.errorMessageCallback = this.errorMessageCallback;</p>
<p> Ex: errorMessageCallback : function(message){</p>
<p> this.view.lblErrorDesc.text = message;</p>
<p> this.view.flxErrorMain.isVisible = true;</p>
<p> },</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...