Skip to content

MsalUriComponent

reference
1 min readUpdated

Kind: Class

Source: Frontend/src/app/msal/msal-uri/msal-uri.component.ts (line 31)

Part of: Frontend

MsalUriComponent handles the MSAL redirect or popup callback flow in the Angular application. It listens for window messages, exchanges data with opened tabs or popup windows, updates login display state, and cleans up listeners when the component is destroyed.

Implements: OnInit

Methods

MethodSignatureReturns
windowMessageListnerwindowMessageListner($event: any)void
ngOnInitngOnInit()void
ngOnDestroyngOnDestroy()void
receiveMessagereceiveMessage(event: any)void
getOpenedTabsgetOpenedTabs()void
fetchDataFromAnotherWindowfetchDataFromAnotherWindow(params: any)void
closeWindowPopupcloseWindowPopup()void
isMeDeveloperisMeDeveloper()boolean
setLoginDisplaysetLoginDisplay()void
fetshMicrosoftDatafetshMicrosoftData()void
loginlogin()void
logoutlogout()void
getDatagetData()void
getContactsgetContacts()void
isPamsLoginisPamsLogin()boolean
sendMailsendMail()void
sendInquirysendInquiry(Inquiry: SalesPotentials)void

Properties

PropertyType
isIframeboolean
loginDisplayany
subscriptionSubscription
NewMailActivities
contentDataURLany[]
TargetInquiryany
MailsListany
CCMailsListany
BCCMailsListany
recipientRecipients
msalAccountAccountInfo
msalUsernamestring
msalUserMailstring
dataToAttachDataToAttach
tokenany
emailMessageEmailMessage

Diagram

mermaid
graph LR
    A[MSAL redirect or popup] --> B[MsalUriComponent]
    B --> C[ngOnInit]
    C --> D[windowMessageListner]
    D --> E[receiveMessage]
    E --> F[getOpenedTabs]
    E --> G[fetchDataFromAnotherWindow]
    G --> H[fetshMicrosoftData]
    H --> I[setLoginDisplay]
    I --> J[closeWindowPopup]
    B --> K[ngOnDestroy]

Usage

typescript
import { Routes } from '@angular/router';
import { MsalUriComponent } from './msal/msal-uri/msal-uri.component';

export const routes: Routes = [
  {
    path: 'msal-uri',
    component: MsalUriComponent
  }
];
typescript
// Configure the MSAL redirect URI to point to the Angular route:
// http://localhost:4200/msal-uri

AI Coding Instructions

  • Keep windowMessageListner() setup paired with cleanup in ngOnDestroy() to prevent duplicate message handlers.
  • Validate the source and origin of messages handled by receiveMessage() before reading authentication or user data.
  • Preserve the popup and tab communication flow between getOpenedTabs(), fetchDataFromAnotherWindow(), and closeWindowPopup().
  • Update UI authentication state through setLoginDisplay() after Microsoft data is fetched by fetshMicrosoftData().
  • Retain the existing fetshMicrosoftData() method name unless all callers are updated together.

Used by

2 references from 2 files. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

Imported by (2)

  • AppRoutingModuleFrontend/src/app/app-routing.module.ts:1
  • TranslateHandlerFrontend/src/app/app.module.ts:1

Was this page helpful?

Download as PDF