Issue with ADFS 2016 oAuth: Users not being redirected to login page post logout

Having an issue with ADFS 2016 and my Angular application using ng2-adal js for authentication and authorization. After users logout, they are not redirected back to the login page. Debug traces in Event Viewer show the following error:

Error: OAuthSignoutProtocolHandler.ValidatePostLogoutRedirectUri: Validation failed. RedirectUrl: http://localhost:4200/login

The specified redirect URL does not match any of the OAuth client's redirect URIs. Logout was successful but there will be no redirection.

URL: http://localhost:4200/login

I have set up the Redirect URL in the ADFS 2016 Application Groups under Native Client. The URL exists as users were able to log in initially.

Any assistance would be greatly appreciated.

Answer №1

After encountering an issue on GitHub (https://github.com/AzureAD/azure-activedirectory-library-for-js/issues/677), I successfully implemented a solution to log out and redirect back to the login page. By including the id_token_hint as a URL parameter in the logout URL, everything worked seamlessly.

To retrieve the value of id_token_hint, it is necessary to access the token received from ADFS. This token is typically stored in SessionStorage and can be accessed by using the command sessionStorage.getItem('adal.idtoken').

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best way to distinguish between a button click and a li click within the same li element

In my angular and css GUI, each line is represented as an li inside a ul with a span. The functionality includes a pop-up opening when clicking on the li background and another action occurring when pressing the button (as intended). The issue arises when ...

Can an Angular 9 application access an uploaded file through an HTTP request from the $_FILES array?

I'm currently facing an issue when attempting to send a file to a PHP server using an HTTP request in Angular 9. The problem lies in the fact that the server is not able to receive the uploaded file in $_FILES. Below is the code snippet I have written ...

Angular mat-select is having difficulty displaying options correctly on mobile devices or devices with narrow widths

In my Angular project, I've encountered an issue with mat-select when viewing options on mobile or low-resolution screens. While the options are still displayed, the text is mysteriously missing. I attempted to set the max width of the mat-option, but ...

Exploring the power of ContentChildren and ViewChildren in AngularElements with Angular 6 - a deep dive into

I have been experimenting with the new AngularElements feature which you can learn more about at https://angular.io/guide/elements. Initially, my tests were successful, but everything came to a halt when I integrated @ContentChildren. It makes sense to me ...

Guide on retrieving an ArrayList() from intricate function in Angular

Simplicity is the key to my question. Let's take a look at this Angular method: getAllOrdersHeaders(){ this.getAllOrdersIds().subscribe(idList=>{ idList.forEach(id=>{ this.ordersCollection.doc(id).collection('metadata&apo ...

Sending data to an API in order to update an object can be accomplished when the controller is handling an Observable within Angular 6

Currently I am utilizing Angular 6 for creating a few basic features and encountering some difficulties with Observables. In one of my components, I retrieve a project on initialization: ngOnInit() { this.project$ = this.route.paramMap.pipe( sw ...

The ace.edit function is unable to locate the #javascript-editor div within the mat-tab

Having trouble integrating an ace editor with Angular material Error: ace.edit cannot locate the div #javascript-editor You can view my code on StackBlitz (check console for errors) app.component.html <mat-tab-group> <mat-tab label="Edito ...

The metadata version discrepancy has been detected for the module located at C:/xampp/htdocs//node_modules/angular2-flash-messages/module/index.d.ts

While working with Angular 4, I encountered an error after trying to install angular2-flash-messages using npm with the following command: npm install angular2-flash-messages --save The error I encountered can be viewed in the following image: enter im ...

Using Angular 4 with Semantic-UI for Dropdown menus

Currently, I am in the process of implementing an Angular directive to handle Semantic UI dropdown. My setup includes Angular (4.3.3), jQuery (3.2.1), and Semantic UI (2.2.13) installed via npm. To make these libraries work together, I made modifications ...

Encountering issues with Angular2 forms while working with JavaScriptServices/Universal

My Angular2 app was built using the JavaScriptServices starter from GitHub. The issue I'm encountering is a runtime error when I include a form in a component. Both FormsModule and ReactiveFormsModule are being imported. This is how my form is stru ...

What are the steps to update data in an md-table?

I'm currently working on a web application using Angular 4, but I'm facing an issue regarding the access to new data in my md-table. To better understand the problem, I have replicated the same example for my application. You can find the examp ...

I'm having trouble understanding why I keep encountering this error message: "SyntaxError: Unexpected token T in JSON at position 0 at JSON.parse (<anonymous>) at XMLHtt…"

I am in the process of implementing a download button feature that will allow users to download a document from my node.js server. Check out this stylish button: https://i.stack.imgur.com/s4CjS.png For the front-end, I am utilizing Angular as the fram ...

Angular does not receive events from Socket.io

Recently I started coding with AngularJS and decided to build a real-time app using Socket.io: The service I'm using shows that the connection is fine on the console. Here's a picture of the Console.log output However, when I attempt to emit c ...

Guide to including a .d.ts file in angular2-seed

Currently, I am utilizing angular2-seed and thoroughly enjoying it. My aim is to incorporate the moment.js library into my project while also making use of its d.ts file. Upon attempting to execute the command typings install..., I encountered some obsta ...

Challenges with Ionic 4 - Module '@angular/core/package.json' not found

Having some trouble with an Ionic 4 project code that works perfectly on my Mac but encounters an error when I try to run it on my Windows 10 PC. The specific error message states "Cannot find module '@angular/core/package.json'". Interestingly, ...

transferring information seamlessly in Ionic using Angular router without the need for navigation

I have a list of names that are displayed, and when I click on any name in the list, it should take me to another page without actually navigating to that path. names.page.html: <ion-content> <ion-list *ngFor='let person of people'&g ...

Display a loading indicator when loading a lazy loaded module in Angular 2

Here's my situation: I have a menu with various options that should be displayed based on user permissions. The majority of the menu items are contained within modules, and these modules are lazy loaded. This means that when a user clicks on a menu it ...

An error was encountered while parsing JSON data in Angular due to an unexpected token

I am currently working on implementing role-based authorization in my project. The goal is to hide certain items in the navigation bar based on the user's role. I encountered an error as shown below. How can I resolve this? service.ts roleMatch(a ...

Angular 2's innovative approach to implementing a sticky footer concept

Is there a way to make my footer sticky without being fixed? I attempted using the CSS negative margin trick, but it did not work as expected. In the provided Plunker code, I tried to replicate the issue in my Angular 2 app. The goal is for the footer to s ...

Angular dependency issue: Expected '{' or ';' for @types/node

I encountered an error while running "ng serve" in my Angular application. Originally built as Angular 2, it was upgraded to Angular 8 (with attempts at versions 6 and 7 along the way). However, after migrating from Angular 5, I started experiencing errors ...