<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Custom login page for Arcgis Server service based authorization in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/custom-login-page-for-arcgis-server-service-based/m-p/1154219#M32748</link>
    <description>&lt;P&gt;By modifying &lt;EM&gt;&lt;STRONG&gt;init.js&lt;/STRONG&gt;&lt;/EM&gt; i succesfully generate token and register it.&lt;/P&gt;&lt;P&gt;Only i must modify a login screen while web app loads.&lt;BR /&gt;İ am trying to put a user logon on web app index.html, but unsuccesfull for now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const loginForm = document.getElementById("login-form");
const loginButton = document.getElementById("login-form-submit");
const loginErrorMsg = document.getElementById("login-error-msg");

loginButton.addEventListener("click", (e) =&amp;gt; {e.preventDefault();
const username = loginForm.username.value;
const password = loginForm.password.value;

require(["esri/IdentityManager","dojo/domReady!"], function(IdentityManager) {


if (loginForm.username.value.includes("domainprefix\\")) {
var username = (loginForm.username.value);
} else {var username = ("domainprefix\\" + loginForm.username.value);};

var password = loginForm.password.value;
var tokenvalue = $.ajax({
type: "POST",
url: "https://domain/arcgis/tokens/generateToken",
data: {
username: username,
password: password,
client: "requestip",
expiration: '60',
f: "json"
},
dataType: "json"
});

if (tokenvalue) {
tokenvalue
.success(function (response){
if (response.token) {

IdentityManager.registerToken({
server: "https://domain/arcgis/rest/services",
token: response.token
});
console.log("TOKEN=" ,response.token);
}
}).error(function(err) {
console.log("operation failed err:" + err);
});
}
});
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;</description>
    <pubDate>Wed, 16 Mar 2022 12:43:49 GMT</pubDate>
    <dc:creator>muygunol</dc:creator>
    <dc:date>2022-03-16T12:43:49Z</dc:date>
    <item>
      <title>Custom login page for Arcgis Server service based authorization</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/custom-login-page-for-arcgis-server-service-based/m-p/1152886#M32715</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are using non federted Arcgis Server 10.6 and using Windows AD as User Store.&lt;/P&gt;&lt;P&gt;Our login usernames like domain\username&lt;/P&gt;&lt;P&gt;With our web applications created by Web App Builder, we want to use username without domain prefix in esri sign in dialog box.&lt;BR /&gt;&lt;BR /&gt;We can generate tokens with Arcgis Server Token Service with post metod.&lt;/P&gt;&lt;P&gt;As i can see web application calls secured web services by addining this token at the end of the service adress while loading web map.&lt;/P&gt;&lt;P&gt;İ want to build a custom login screen, users input their identity data then by using post with domain prefix i will get token for secured services and redirect to web app builder application.&lt;BR /&gt;But how to use this token with web application on the redirected page to bypass esri identity manager?&lt;BR /&gt;Thanks...&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Arcgis Gis Server 10.6&lt;BR /&gt;Server Security&lt;BR /&gt;User Store: Windows Domain&lt;BR /&gt;Role Store:ArcGIS Server Built-in&lt;BR /&gt;Authentication Tier:GIS Server&lt;BR /&gt;Authentication Mode:ArcGIS Tokens&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 11:05:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/custom-login-page-for-arcgis-server-service-based/m-p/1152886#M32715</guid>
      <dc:creator>muygunol</dc:creator>
      <dc:date>2022-03-11T11:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: Custom login page for Arcgis Server service based authorization</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/custom-login-page-for-arcgis-server-service-based/m-p/1154219#M32748</link>
      <description>&lt;P&gt;By modifying &lt;EM&gt;&lt;STRONG&gt;init.js&lt;/STRONG&gt;&lt;/EM&gt; i succesfully generate token and register it.&lt;/P&gt;&lt;P&gt;Only i must modify a login screen while web app loads.&lt;BR /&gt;İ am trying to put a user logon on web app index.html, but unsuccesfull for now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const loginForm = document.getElementById("login-form");
const loginButton = document.getElementById("login-form-submit");
const loginErrorMsg = document.getElementById("login-error-msg");

loginButton.addEventListener("click", (e) =&amp;gt; {e.preventDefault();
const username = loginForm.username.value;
const password = loginForm.password.value;

require(["esri/IdentityManager","dojo/domReady!"], function(IdentityManager) {


if (loginForm.username.value.includes("domainprefix\\")) {
var username = (loginForm.username.value);
} else {var username = ("domainprefix\\" + loginForm.username.value);};

var password = loginForm.password.value;
var tokenvalue = $.ajax({
type: "POST",
url: "https://domain/arcgis/tokens/generateToken",
data: {
username: username,
password: password,
client: "requestip",
expiration: '60',
f: "json"
},
dataType: "json"
});

if (tokenvalue) {
tokenvalue
.success(function (response){
if (response.token) {

IdentityManager.registerToken({
server: "https://domain/arcgis/rest/services",
token: response.token
});
console.log("TOKEN=" ,response.token);
}
}).error(function(err) {
console.log("operation failed err:" + err);
});
}
});
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Wed, 16 Mar 2022 12:43:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/custom-login-page-for-arcgis-server-service-based/m-p/1154219#M32748</guid>
      <dc:creator>muygunol</dc:creator>
      <dc:date>2022-03-16T12:43:49Z</dc:date>
    </item>
  </channel>
</rss>

