Nowadays, offering a mobile application for any software solution has become a modern-day necessity. Our goal is to secure the user by considering security aspects of mobile device and based on this device information we can decide to authenticate the user with minimal steps, improving the user experience or step up or even block access if the device is in an unsecured state.Entgra IS React Native Sample application demonstrate how to step up or step down authentication based on device attributes.
You can experience the capabilities of Entgra IS React Native Sample Application by following this small guide which contains main sections listed below.
Register the application in Entgra IoT server by using following CURL command. For the Authorization header encode username:password to Base64 format and use the encoded value as 'Authorization: Basic {encodedValue}'. Provide any name for the applicationName and provide the application owner’s username for the username. Copy the values of client_id and client_secret.
curl --location --request POST '<https://mgt.ciam.entgra.net/api-application-registration/register>' \\
--header 'Accept: application/json' \\
--header 'Authorization: Basic d3NvMmFkbWluOndzbzJhZG1pbg==' \\
--header 'Content-Type: application/json' \\
--data-raw '{"applicationName":"cdmf_android_4811a7d39b09d709","tags":["android","device_management"],"username":"wso2admin", "password":"wso2admin", "allowedToAllDomains":false,"mappingAnExistingOAuthApp":false}'
Response:
{"client_secret":"gBb6LATYVyxplGhvB6tcckBOvo8a","client_id":"O6lYcMOwg1wl9OfhCrUDB_QTkKwa"}
Login to Entgra IoT management console from https://{mgtURL}/carbon and navigate to the Service Providers tab listed under the Main section. You will see the service provider you created above.
Expand the OAuth/OpenID Connect Configuration section inside Inbound Authentication Configuration section and check if the OAuth Client Key is same as the client_id you got from the above response.
Click on Edit button and you will be redirected to Application Settings page.
Make sure Code option in Allowed Grant Types and Default in Token Issuer are ticked. Provide a valid URL format ending with /sdk/secure for Callback Url section.

