{"id":1191,"date":"2020-11-09T05:09:44","date_gmt":"2020-11-09T05:09:44","guid":{"rendered":"https:\/\/demo.securemetric.com\/docs\/?page_id=1191"},"modified":"2022-07-20T02:23:57","modified_gmt":"2022-07-20T10:23:57","slug":"cr-otp-authentication-api","status":"publish","type":"page","link":"https:\/\/console.centagatecloud.com\/docs\/?page_id=1191","title":{"rendered":"CR OTP Authentication API"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"1191\" class=\"elementor elementor-1191\">\n\t\t\t\t\t\t<div class=\"elementor-inner\">\n\t\t\t\t<div class=\"elementor-section-wrap\">\n\t\t\t\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-28b54d5 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"28b54d5\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-dec9b02\" data-id=\"dec9b02\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-288b1ea elementor-widget elementor-widget-spacer\" data-id=\"288b1ea\" data-element_type=\"widget\" data-widget_type=\"spacer.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-spacer\">\n\t\t\t<div class=\"elementor-spacer-inner\"><\/div>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-531647d elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"531647d\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-f6b4c66\" data-id=\"f6b4c66\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-e2423a8 elementor-widget elementor-widget-heading\" data-id=\"e2423a8\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">CR OTP Authentication API<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-c5a911a elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"c5a911a\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-fef2299\" data-id=\"fef2299\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-69960aa elementor-widget elementor-widget-text-editor\" data-id=\"69960aa\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<p>Authentication function that verify username and Challenge Response OTP combination. User has to request an OTP challenge code before call this function . User will generate a correspond OTP based on the challenge code.<\/p>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-4844fe6 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"4844fe6\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-d91fb10\" data-id=\"d91fb10\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-8836a43 elementor-widget elementor-widget-text-editor\" data-id=\"8836a43\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<p>Below is the URL to access the API functions:<\/p>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-5c7401e elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"5c7401e\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-d681fb7\" data-id=\"d681fb7\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-04ec2d1 elementor-widget elementor-widget-code-block-for-elementor\" data-id=\"04ec2d1\" data-element_type=\"widget\" data-widget_type=\"code-block-for-elementor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<pre class='theme-twilight' data-show-toolbar='yes'><code class='language-http'>POST \/v2\/CentagateWS\/webresources\/auth\/authCrOtp<\/code><\/pre>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-2d9a0f8 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"2d9a0f8\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-309971d\" data-id=\"309971d\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-8fd9f32 elementor-widget elementor-widget-heading\" data-id=\"8fd9f32\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Parameters<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-ca702b3 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"ca702b3\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-f5f7ed4\" data-id=\"f5f7ed4\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-ef6a4fa elementor-widget elementor-widget-htmega-datatable-addons\" data-id=\"ef6a4fa\" data-element_type=\"widget\" data-widget_type=\"htmega-datatable-addons.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t        <div class=\"htmega-table-style htmega-table-style-2 htb-table-responsive\">\r\n            <table class=\"htb-table \">\r\n                                    <thead>\r\n                        <tr>\r\n                            <th class='elementor-repeater-item-07ced03'>No<\/th><th class='elementor-repeater-item-d1886a7'>Parameter<\/th><th class='elementor-repeater-item-2ebc75f'>Occurence<\/th><th class='elementor-repeater-item-65080f3'>Descriptions<\/th>                        <\/tr>\r\n                    <\/thead>\r\n                                <tbody>\r\n                                            <tr>\r\n                            <td class=\"elementor-repeater-item-7719e86\" >1<\/td><td class=\"elementor-repeater-item-2dfdccf\" >username<\/td><td class=\"elementor-repeater-item-1e16c08\" >Required<\/td><td class=\"elementor-repeater-item-6353bca\" >Register Username in CENTAGATE Cloud.<\/td>                        <\/tr>\r\n                                            <tr>\r\n                            <td class=\"elementor-repeater-item-5a397b7\" >2<\/td><td class=\"elementor-repeater-item-1c130b8\" >devAccId<\/td><td class=\"elementor-repeater-item-4cefe21\" >Required<\/td><td class=\"elementor-repeater-item-e0f91d6\" >The user registered device account Id<\/td>                        <\/tr>\r\n                                            <tr>\r\n                            <td class=\"elementor-repeater-item-e275256\" >3<\/td><td class=\"elementor-repeater-item-d082790\" >Challenge<\/td><td class=\"elementor-repeater-item-4470a4e\" >Required<\/td><td class=\"elementor-repeater-item-40fc41a\" >Challenge Code That Is Sent From Server To User<\/td>                        <\/tr>\r\n                                            <tr>\r\n                            <td class=\"elementor-repeater-item-ae40b7c\" >4<\/td><td class=\"elementor-repeater-item-1dfd077\" >crOtp<\/td><td class=\"elementor-repeater-item-d53a60c\" >Required<\/td><td class=\"elementor-repeater-item-a60242d\" >Challenge Response OTP that generated from in CENTAGATE Cloud App.<\/td>                        <\/tr>\r\n                                            <tr>\r\n                            <td class=\"elementor-repeater-item-a7036ac\" >5<\/td><td class=\"elementor-repeater-item-9134eaa\" >authToken<\/td><td class=\"elementor-repeater-item-6e1fbab\" >Optional<\/td><td class=\"elementor-repeater-item-d83f0c4\" >The Previous Generated AuthToken.\u200b<\/td>                        <\/tr>\r\n                                            <tr>\r\n                            <td class=\"elementor-repeater-item-4683563\" >6<\/td><td class=\"elementor-repeater-item-ec67445\" >integrationKey<\/td><td class=\"elementor-repeater-item-f3d360b\" >Required<\/td><td class=\"elementor-repeater-item-df58a98\" >Integration Key Of The App That The User Wants To Authenticate.<\/td>                        <\/tr>\r\n                                            <tr>\r\n                            <td class=\"elementor-repeater-item-fd6c9c1\" >7<\/td><td class=\"elementor-repeater-item-1b5eebb\" >unixTimestamp<\/td><td class=\"elementor-repeater-item-22a1345\" >Required<\/td><td class=\"elementor-repeater-item-72c846b\" >Current Time In Unixtimestamp<\/td>                        <\/tr>\r\n                                            <tr>\r\n                            <td class=\"elementor-repeater-item-5ac25bc\" >8<\/td><td class=\"elementor-repeater-item-708a3dc\" >supportFido<\/td><td class=\"elementor-repeater-item-5573d4f\" >Optional<\/td><td class=\"elementor-repeater-item-2bff541\" >FIDO Authentication Option, Pass True To Enable And False To Disable. Or Leave It Empty<\/td>                        <\/tr>\r\n                                            <tr>\r\n                            <td class=\"elementor-repeater-item-cac3a01\" >9<\/td><td class=\"elementor-repeater-item-b8a7a2d\" >ipAddress<\/td><td class=\"elementor-repeater-item-1d3f90d\" >Optional<\/td><td class=\"elementor-repeater-item-56e84be\" >IP Address From Where The Authentication Request Is Originated.<\/td>                        <\/tr>\r\n                                            <tr>\r\n                            <td class=\"elementor-repeater-item-76061ec\" >10<\/td><td class=\"elementor-repeater-item-7a874c9\" >userAgent<\/td><td class=\"elementor-repeater-item-9e952b2\" >Optional<\/td><td class=\"elementor-repeater-item-d6a8646\" >Platform Information Of Authentication Request Is Made Of.<\/td>                        <\/tr>\r\n                                            <tr>\r\n                            <td class=\"elementor-repeater-item-fcf7c36\" >11<\/td><td class=\"elementor-repeater-item-394a08b\" >browserFp<\/td><td class=\"elementor-repeater-item-d44a122\" >Optional<\/td><td class=\"elementor-repeater-item-e40f141\" >Browser Fingerprint.<\/td>                        <\/tr>\r\n                                            <tr>\r\n                            <td class=\"elementor-repeater-item-1d416da\" >12<\/td><td class=\"elementor-repeater-item-c275244\" >otpType<\/td><td class=\"elementor-repeater-item-d543ebf\" >Optional<\/td><td class=\"elementor-repeater-item-33666fa\" >Insert \"Online\" If Its Mobile Token Or Insert \"Offline\" If Its Hardware Token<\/td>                        <\/tr>\r\n                                            <tr>\r\n                            <td class=\"elementor-repeater-item-c84f48f\" >13<\/td><td class=\"elementor-repeater-item-cfe1ff6\" >tokenId<\/td><td class=\"elementor-repeater-item-bae6f6d\" >Optional<\/td><td class=\"elementor-repeater-item-1fe2863\" >Insert Hardware Token Serial Number, If User Register More Than One Hardware Token, Need To Specify The Hardware Token Serial Number<\/td>                        <\/tr>\r\n                                            <tr>\r\n                            <td class=\"elementor-repeater-item-0b338e9\" >14<\/td><td class=\"elementor-repeater-item-19f7876\" >HMAC<\/td><td class=\"elementor-repeater-item-b8fb335\" >Required<\/td><td class=\"elementor-repeater-item-aa09fe1\" >Hmac Generated From Combination (Username + DevAccId + CrOtp + OtpType + Challenge + IntegrationKey + UnixTimeStamp + AuthToken + SupportFido + IpAddress + UserAgent + BrowserFp) Using Secretkey (Can Be Obtained From The App Page) As The Key<\/td>                        <\/tr>\r\n                                    <\/tbody>\r\n            <\/table>\r\n        <\/div>\r\n        \t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-67a1124 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"67a1124\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-3bb3026\" data-id=\"3bb3026\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-6a19f46 elementor-widget elementor-widget-spacer\" data-id=\"6a19f46\" data-element_type=\"widget\" data-widget_type=\"spacer.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-spacer\">\n\t\t\t<div class=\"elementor-spacer-inner\"><\/div>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-a20fd60 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"a20fd60\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-2c3e8e8\" data-id=\"2c3e8e8\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-2986b74 elementor-widget elementor-widget-heading\" data-id=\"2986b74\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-xl\">Sample Code<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-20f85ef elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"20f85ef\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-7c24ca5\" data-id=\"7c24ca5\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-0d326ca elementor-widget elementor-widget-text-editor\" data-id=\"0d326ca\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<p>As in below there are some examples of source code of access the API functions:<\/p>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-fdd132e elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"fdd132e\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-9501a77\" data-id=\"9501a77\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-dd8beb6 elementor-tabs-view-horizontal elementor-widget elementor-widget-tabs\" data-id=\"dd8beb6\" data-element_type=\"widget\" data-widget_type=\"tabs.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-tabs\">\n\t\t\t<div class=\"elementor-tabs-wrapper\" role=\"tablist\" >\n\t\t\t\t\t\t\t\t\t<div id=\"elementor-tab-title-2321\" class=\"elementor-tab-title elementor-tab-desktop-title\" aria-selected=\"true\" data-tab=\"1\" role=\"tab\" tabindex=\"0\" aria-controls=\"elementor-tab-content-2321\" aria-expanded=\"false\"><a href=\"\">Java<\/a><\/div>\n\t\t\t\t\t\t\t\t\t<div id=\"elementor-tab-title-2322\" class=\"elementor-tab-title elementor-tab-desktop-title\" aria-selected=\"false\" data-tab=\"2\" role=\"tab\" tabindex=\"-1\" aria-controls=\"elementor-tab-content-2322\" aria-expanded=\"false\"><a href=\"\">Node Js<\/a><\/div>\n\t\t\t\t\t\t\t\t\t<div id=\"elementor-tab-title-2323\" class=\"elementor-tab-title elementor-tab-desktop-title\" aria-selected=\"false\" data-tab=\"3\" role=\"tab\" tabindex=\"-1\" aria-controls=\"elementor-tab-content-2323\" aria-expanded=\"false\"><a href=\"\">PHP<\/a><\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t\t<div class=\"elementor-tabs-content-wrapper\" role=\"tablist\" aria-orientation=\"vertical\">\n\t\t\t\t\t\t\t\t\t<div class=\"elementor-tab-title elementor-tab-mobile-title\" aria-selected=\"true\" data-tab=\"1\" role=\"tab\" tabindex=\"0\" aria-controls=\"elementor-tab-content-2321\" aria-expanded=\"false\">Java<\/div>\n\t\t\t\t\t<div id=\"elementor-tab-content-2321\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"1\" role=\"tabpanel\" aria-labelledby=\"elementor-tab-title-2321\" tabindex=\"0\" hidden=\"false\"><p>\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"3770\" class=\"elementor elementor-3770\">\n\t\t\t\t\t\t<div class=\"elementor-inner\">\n\t\t\t\t<div class=\"elementor-section-wrap\">\n\t\t\t\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-8cef304 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"8cef304\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-180bd7c\" data-id=\"180bd7c\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-b984745 elementor-widget elementor-widget-code-block-for-elementor\" data-id=\"b984745\" data-element_type=\"widget\" data-widget_type=\"code-block-for-elementor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<pre class='line-numbers theme-tomorrow-night' data-show-toolbar='yes'><code class='language-java'>public static void main(String[] args) {\r\n\r\n\tClientConfig config = new DefaultClientConfig ();\r\n\tClient client = Client.create ( config );\r\n\tWebResource service = client.resource (&quot;https:\/\/&lt;domain_name&gt;\/v2\/CentagateWS\/webresources&quot;);\r\n\t\t\t\r\n\tGson gson = new Gson();\r\n\t\t\t\r\n\tString hmac = convertHmacSha256(&quot;secretkey&quot;,&quot;username&quot; + &quot;devAccId&quot; + &quot;crOtp&quot; + &quot;otpType&quot; + &quot;challenge&quot; + &quot;integrationKey&quot; + &quot;unixTimestamp&quot; + &quot;authToken&quot;  + &quot;supportFido&quot; + &quot;ipAddress&quot; + &quot;userAgent&quot; + &quot;browserFp&quot;);\r\n\r\n\tHashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();\r\n\tmap.put(&quot;username&quot;, &quot;username&quot;);\r\n\tmap.put(&quot;devAccId&quot;, &quot;devAccId&quot;);\r\n\tmap.put(&quot;crOtp&quot;, &quot;crOtp&quot;);\r\n\tmap.put(&quot;challenge&quot;, &quot;challenge&quot;); \/\/Challenge OTP that will generate during the Req Cr OTP\r\n\tmap.put(&quot;otpType&quot;, &quot;otpType&quot;); \/\/Insert 'online' if mobile token and 'offline' if hardware token\r\n\tmap.put(&quot;tokenId&quot;, &quot;tokenId&quot;); \/\/Need insert hardware token serial number, if user register more than one hardware token and then need to specify the hardware token serial number\r\n\tmap.put(&quot;authToken&quot;, &quot;authToken&quot;);\r\n\tmap.put(&quot;integrationKey&quot;, &quot;integrationKey&quot;);\r\n\tmap.put(&quot;unixTimestamp&quot;, &quot;unixTimeStamp&quot;);\r\n\tmap.put(&quot;ipAddress&quot;, &quot;ipAddress&quot;); \r\n\tmap.put(&quot;userAgent&quot;, &quot;userAgent&quot;); \r\n\tmap.put(&quot;browserFp&quot;, &quot;browserFp&quot;); \r\n\tmap.put(&quot;supportFido&quot;, &quot;&quot;); \r\n\tmap.put(&quot;hmac&quot;, hmac); \r\n\r\n\tClientResponse response = service.path (&quot;auth&quot;).path(&quot;authCrOtp&quot;).accept(MediaType.APPLICATION_JSON).post(ClientResponse.class, gson.toJson(map));\r\n\t\t\t\t\r\n\tString retJson = response.getEntity(String.class);\r\n\r\n\tHashMap&lt;String, Object&gt; returnData = (HashMap&lt;String, Object&gt;) gson.fromJson(retJson, HashMap.class);\r\n\r\n\tString code = returnData.get(&quot;code&quot;).toString();\r\n\tString message = returnData.get(&quot;message&quot;).toString();\r\n\tString object = returnData.get(&quot;object&quot;).toString();\r\n}\r\n\r\npublic static String convertHmacSha256(String secretKey, String params) throws NoSuchAlgorithmException, \r\n            InvalidKeyException,IllegalStateException, SignatureException, NoSuchProviderException, Exception\r\n{\r\n\ttry\r\n\t{\r\n\t\tfinal SecretKeySpec secret_key = new SecretKeySpec ( StringUtils.getBytesUtf8 ( secretKey ) , &quot;HmacSHA256&quot; );\r\n\t\tfinal Mac mac = Mac.getInstance ( &quot;HmacSHA256&quot; );\r\n\t\tmac.init ( secret_key );\r\n\t\tfinal byte[] bytes = mac.doFinal ( StringUtils.getBytesUtf8 ( params ) );\r\n\t\treturn Hex.encodeHexString ( bytes );\r\n\t}\r\n\tcatch ( NoSuchAlgorithmException e )\r\n\t{\r\n\t\tthrow new NoSuchAlgorithmException ( e );\r\n\t}\r\n\tcatch ( InvalidKeyException e )\r\n\t{\r\n\t\tthrow new InvalidKeyException ( e );\r\n\t}\r\n\tcatch ( IllegalStateException e )\r\n\t{\r\n\t\tthrow new IllegalStateException ( e );\r\n\t}\r\n\tcatch ( Exception e )\r\n\t{\r\n\t\tthrow new Exception ( e );\r\n\t}\r\n}<\/code><\/pre>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/p><\/div>\n\t\t\t\t\t\t\t\t\t<div class=\"elementor-tab-title elementor-tab-mobile-title\" aria-selected=\"false\" data-tab=\"2\" role=\"tab\" tabindex=\"-1\" aria-controls=\"elementor-tab-content-2322\" aria-expanded=\"false\">Node Js<\/div>\n\t\t\t\t\t<div id=\"elementor-tab-content-2322\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"2\" role=\"tabpanel\" aria-labelledby=\"elementor-tab-title-2322\" tabindex=\"0\" hidden=\"hidden\"><p>\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"3772\" class=\"elementor elementor-3772\">\n\t\t\t\t\t\t<div class=\"elementor-inner\">\n\t\t\t\t<div class=\"elementor-section-wrap\">\n\t\t\t\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-2a1761f elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"2a1761f\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-da77004\" data-id=\"da77004\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-d8fc0c5 elementor-widget elementor-widget-code-block-for-elementor\" data-id=\"d8fc0c5\" data-element_type=\"widget\" data-widget_type=\"code-block-for-elementor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<pre class='line-numbers theme-tomorrow-night' data-show-toolbar='yes'><code class='language-javascript'>const https = require('https')\r\n\r\nvar crypto = require('crypto');\r\nvar username = '&lt;username&gt;';\r\nvar devAccId = '&lt;devAccId&gt;';\r\nvar crOtp = '&lt;crOtp&gt;';\r\nvar challenge = '&lt;challenge&gt;';\r\nvar integrationKey = '&lt;integration key&gt;';\r\n\r\nvar time = Math.round((new Date()).getTime() \/ 1000);\r\nvar unixTimestamp = time.toString();\r\nvar authToken = '&lt;authToken&gt;';\r\n\r\nvar supportFido = &quot;&lt;supportFido&gt;&quot;;\r\nvar ipAddress = &quot;&lt;ipAddress&gt;&quot;;\r\nvar userAgent = &quot;&lt;userAgent&gt;&quot;;\r\nvar browserFp = &quot;&lt;browserFp&gt;&quot;;\r\n\r\nvar secretKey    = '&lt;secret key&gt;';  \r\nvar hmacText = username + devAccId + crOtp + challenge + authToken + integrationKey + unixTimestamp + supportFido + ipAddress + userAgent + browserFp;\r\nvar hash, hmac;\r\n\r\n\/* generate hmac value*\/\r\nhmac = crypto.createHmac(sha256, secretKey);    \r\nhmac.write(hmacText);\r\nhmac.end();      \r\nhash = hmac.read().toString('hex');    \r\n\r\n\r\nconst data = JSON.stringify({\r\n\tusername: username,\r\n\tdevAccId: devAccId,\r\n\tcrOtp: crOtp,\r\n\tchallenge: challenge,\r\n\tauthToken: authToken,\r\n\tintegrationKey: integrationKey,\r\n\tunixTimestamp: unixTimestamp,\r\n\tipAddress: ipAddress,\r\n\tsupportFido: supportFido,\r\n\tuserAgent: userAgent,\r\n\tbrowserFp: browserFp,\r\n\thmac: hash\r\n})\r\n\r\nconst options = {\r\n\thostname: &quot;&lt;domain_name&gt;&quot;,\r\n\tport: 443,\r\n\tpath:'\/v2\/CentagateWS\/webresources\/auth\/authCrOtp',\r\n\tmethod: 'POST',\r\n\theaders: {\r\n\t\t'Accept': 'application\/json',\r\n\t\t'Content-Type': 'application\/json',\r\n\t}\r\n}\r\n\r\nconst req = https.request(options, res =&gt;{\r\n\tconsole.log(`HTTP Status Code: ${res.statusCode}`)\r\n\tvar body = '';\r\n\tres.on('data', function(d){\r\n\t\t\r\n\tbody += d;\r\n\tvar parsed = JSON.parse(body);\r\n\t\r\n\tif (parsed.code == 0){\r\n\t   console.log('Authentication Succeed');\r\n\t   console.log('Response:');\r\n\t   console.log(body);\r\n\t}\r\n\telse {\r\n\t  console.log('Authentication Fail, ' +'Message:' + parsed.message);\r\n\t  console.log('Code:' + parsed.code); \r\n\t}\r\n\t\t\r\n\t})\r\n})\r\n\r\nreq.on('ERROR', error =&gt; {\r\n\tconsole.error(error)\r\n})\r\n\r\nreq.write(data)\r\nreq.end()<\/code><\/pre>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/p><\/div>\n\t\t\t\t\t\t\t\t\t<div class=\"elementor-tab-title elementor-tab-mobile-title\" aria-selected=\"false\" data-tab=\"3\" role=\"tab\" tabindex=\"-1\" aria-controls=\"elementor-tab-content-2323\" aria-expanded=\"false\">PHP<\/div>\n\t\t\t\t\t<div id=\"elementor-tab-content-2323\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"3\" role=\"tabpanel\" aria-labelledby=\"elementor-tab-title-2323\" tabindex=\"0\" hidden=\"hidden\"><p>\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"3774\" class=\"elementor elementor-3774\">\n\t\t\t\t\t\t<div class=\"elementor-inner\">\n\t\t\t\t<div class=\"elementor-section-wrap\">\n\t\t\t\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-cde24f6 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"cde24f6\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-6f66136\" data-id=\"6f66136\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-f54e14a elementor-widget elementor-widget-code-block-for-elementor\" data-id=\"f54e14a\" data-element_type=\"widget\" data-widget_type=\"code-block-for-elementor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<pre class='line-numbers theme-tomorrow-night' data-show-toolbar='yes'><code class='language-php'>&lt;?php\r\n\r\n    $url = 'https:\/\/&lt;domain_name&gt;\/v2\/CentagateWS\/webresources\/auth\/authCrOtp';\r\n    \r\n    $ch = curl_init($url);\r\n    $secretKey = &quot;&lt;secretkey&gt;&quot;;\r\n    $username =&quot;&lt;username&gt;&quot;;\r\n    $devAccId = &quot;&lt;devAccId&gt;&quot;;\r\n    $crOtp = &quot;&lt;crOtp&gt;&quot;; \/\/Respond OTP\r\n\t$otpType = &quot;&lt;otpType&gt;&quot;; \/\/online if mobile token and offline if hardware token\r\n\t$tokenId = &quot;&lt;tokenId&gt;&quot;;\r\n    $challenge = &quot;&lt;challenge&gt;&quot;; \/\/Challenge OTP that will generate during the Req CR OTP\r\n    $authToken = &quot;&lt;authToken&gt;&quot;;\r\n    $integrationKey = &quot;&lt;integrationkey&gt;&quot;;\r\n    $time = time(); \/\/ get current timestamp\r\n    $unixTimestamp = strval($time); \/\/convert timestamp to String\r\n    $supportFido = &quot;&lt;supportFido&gt;&quot;;\r\n    $ipAddress = &quot;&lt;ipAddress&gt;&quot;;\r\n    $userAgent = &quot;&lt;userAgent&gt;&quot;;\r\n    $browserFp = &quot;&lt;browserFp&gt;&quot;;\r\n    \r\n    $hmac_text = $username.$devAccId.$crOtp.$otpType.$challenge.$integrationKey.$unixTimestamp.$authToken.$supportFido.$ipAddress.$userAgent.$browserFp;\r\n    $hmac = hash_hmac('sha256', $hmac_text, $secretKey); \/\/ calculate hmac value\r\n    \r\n    $jsonData = array (\r\n\t\t'otpType'=&gt; $otpType,\r\n\t\t'tokenId'=&gt; $tokenId,\r\n    \t'username'=&gt; $username,\r\n    \t'crOtp'=&gt; $crOtp,\r\n    \t'challenge'=&gt; $challenge,\r\n\t\t'devAccId'=&gt; $devAccId,\r\n    \t'integrationKey'=&gt; $integrationKey,\r\n    \t'unixTimestamp'=&gt; $unixTimestamp,\r\n\t\t'ipAddress'=&gt; $ipAddress,\r\n\t\t'userAgent'=&gt; $userAgent,\r\n\t\t'browserFp'=&gt; $browserFp,\r\n\t\t'authToken'=&gt; $authToken,\r\n    \t'supportFido'=&gt; $supportFido,\r\n    \t'hmac' =&gt; $hmac\r\n    );\r\n    \r\n    $jsonDataEncoded = json_encode($jsonData);\r\n    \r\n    curl_setopt($ch, CURLOPT_POST,1);\r\n    curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonDataEncoded);\r\n    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application\/json','Content-Type: application\/json'));\r\n    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n    \r\n    $result = curl_exec($ch);\r\n    \r\n    \r\n    $obj = json_decode($result); \r\n    if ($obj-&gt;{'code'} != 0){\r\n    \tprint &quot;Authentication fail&quot;;\r\n    \tprint &quot;Message: &quot;.$obj-&gt;{'message'}; \r\n    \techo &quot; &lt;br&gt;&quot;; \r\n    \tprint &quot;Code: &quot;.$obj-&gt;{'code'};\r\n    }\r\n    else {\r\n    \tprint &quot;Authentication succeed&quot;;\r\n    \techo &quot; &lt;br&gt;&quot;; \r\n    \tprint &quot;Message: &quot;.$obj-&gt;{'message'}; \r\n    \techo &quot; &lt;br&gt;&quot;; \r\n    \tprint &quot;Code: &quot;.$obj-&gt;{'code'}; \r\n    \techo &quot; &lt;br&gt;&quot;; \r\n    \tprint &quot;Result:&quot; ;\r\n    \techo &quot; &lt;br&gt;&quot;; \r\n    \tprint $result;\r\n    }\r\n    \r\n    curl_close($ch);\r\n\r\n?&gt;<\/code><\/pre>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/p><\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>CR OTP Authentication API Authentication function that verify username and Challenge Response OTP combination. User has to request an OTP challenge code before call this function . User will generate a correspond OTP based on the challenge code. Below is the URL to access the API functions: POST \/v2\/CentagateWS\/webresources\/auth\/authCrOtp Parameters No Parameter Occurence Descriptions 1 [&hellip;]<\/p>\n<a class=\"read-more-tag\" \n         href=\"https:\/\/console.centagatecloud.com\/docs\/?page_id=1191\">&nbsp;Read More<\/a>","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/console.centagatecloud.com\/docs\/index.php?rest_route=\/wp\/v2\/pages\/1191"}],"collection":[{"href":"https:\/\/console.centagatecloud.com\/docs\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/console.centagatecloud.com\/docs\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/console.centagatecloud.com\/docs\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/console.centagatecloud.com\/docs\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1191"}],"version-history":[{"count":31,"href":"https:\/\/console.centagatecloud.com\/docs\/index.php?rest_route=\/wp\/v2\/pages\/1191\/revisions"}],"predecessor-version":[{"id":6181,"href":"https:\/\/console.centagatecloud.com\/docs\/index.php?rest_route=\/wp\/v2\/pages\/1191\/revisions\/6181"}],"wp:attachment":[{"href":"https:\/\/console.centagatecloud.com\/docs\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}