<?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: Angular 19 - Portal Authentication Sample in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/angular-19-portal-authentication-sample/m-p/1562743#M86136</link>
    <description>&lt;P&gt;I disabled ssr in my angular.json file and it seems to work.&lt;/P&gt;&lt;LI-CODE lang="c"&gt; "prerender": false,
 "ssr": false&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 26 Nov 2024 17:51:31 GMT</pubDate>
    <dc:creator>PierreMasson</dc:creator>
    <dc:date>2024-11-26T17:51:31Z</dc:date>
    <item>
      <title>Angular 19 - Portal Authentication Sample</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/angular-19-portal-authentication-sample/m-p/1562661#M86134</link>
      <description>&lt;LI-CODE lang="javascript"&gt;import { Component, Inject, OnInit, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { CommonModule, DOCUMENT } from '@angular/common';

import IdentityManager from "@arcgis/core/identity/IdentityManager";
import ServerInfo from "@arcgis/core/identity/ServerInfo";

@Component({
  selector: 'app-home',
  standalone: true,
  imports: [ CommonModule ],
  providers: [ ],
  templateUrl: './home.component.html',
  styleUrl: './home.component.scss',
  schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class HomeComponent implements OnInit {

  constructor() { }

  ngOnInit(): void {
    
    var si = new ServerInfo({
      hasPortal: true,
      server: 'http://myportal.mydomain.com/arcgis',
    });
 
    IdentityManager.registerServers([si]);

    IdentityManager.getCredential(environment.portalUrl);

    IdentityManager.checkSignInStatus(si.server + "/sharing")
    .then(() =&amp;gt; {
      console.log("checkSignInStatus: User is signed in.");
    })
    .catch(() =&amp;gt; { 
      console.error("checkSignInStatus: User not signed in.") 
    });
  }

}&lt;/LI-CODE&gt;&lt;P&gt;I'm developping an Angular 19 app using&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/642472"&gt;@ArcGIS&lt;/a&gt;/core &amp;amp;&amp;amp;&amp;nbsp;&lt;SPAN&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/642472"&gt;@ArcGIS&lt;/a&gt;/map-components and thing are going well. Only thing left to do is the portal authentication (get a token).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is there a sample somewhere to help me. I find stuff here and there some with deprecated stuff, some in pure JS but I want to do it cleanly with Angular.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I have tried this but I get this erreor after the build:&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Error when evaluating SSR module..&amp;nbsp;ReferenceError: ResizeObserver is not defined&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Can you help with a sample please?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import { Component, Inject, OnInit, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { CommonModule, DOCUMENT } from '@angular/common';

import IdentityManager from "@arcgis/core/identity/IdentityManager";
import ServerInfo from "@arcgis/core/identity/ServerInfo";

@Component({
  selector: 'app-home',
  standalone: true,
  imports: [ CommonModule ],
  providers: [ ],
  templateUrl: './home.component.html',
  styleUrl: './home.component.scss',
  schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class HomeComponent implements OnInit {

  constructor() { }

  ngOnInit(): void {
    
    var si = new ServerInfo({
      hasPortal: true,
      server: 'http://myportal.mydomain.com/arcgis',
    });
 
    IdentityManager.getCredential(environment.portalUrl);
    IdentityManager.registerServers([si]);

    IdentityManager.checkSignInStatus(si.server + "/sharing")
    .then(() =&amp;gt; {
      console.log("checkSignInStatus: User is signed in.");
    })
    .catch(() =&amp;gt; { 
      console.error("checkSignInStatus: User not signed in.") 
    });
  }

}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2024 17:07:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/angular-19-portal-authentication-sample/m-p/1562661#M86134</guid>
      <dc:creator>PierreMasson</dc:creator>
      <dc:date>2024-11-26T17:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: Angular 19 - Portal Authentication Sample</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/angular-19-portal-authentication-sample/m-p/1562743#M86136</link>
      <description>&lt;P&gt;I disabled ssr in my angular.json file and it seems to work.&lt;/P&gt;&lt;LI-CODE lang="c"&gt; "prerender": false,
 "ssr": false&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2024 17:51:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/angular-19-portal-authentication-sample/m-p/1562743#M86136</guid>
      <dc:creator>PierreMasson</dc:creator>
      <dc:date>2024-11-26T17:51:31Z</dc:date>
    </item>
  </channel>
</rss>

