4 ways to fix error AADSTS65001 (The user or administrator has not consented to use the application)

Azure AD Login error

Fixing issues with Azure AD authentication for Enterprise applications can be tricky. This article contains multiple different fixes to an issue, where granting admin consent has somehow failed. Not all of the different solutions will work for all situations, though! That’s why I included a couple of different options to try… 🙂

Why do you even get issues with Admin Consent (like AADSTS65001)?

You’re trying to add or use an app, that requires such permissions from your tenant, that can only be granted by an administrator. Typically this app has to be added by a global administrator. If it’s an enterprise application, it could also be in an invalid state after someone tried adding the app without sufficient permissions.

Our investigation was focused on a mobile app, that’s deployed as an enterprise app. Most of the things should apply for web-based apps or console programs or whatever else you’re deploying, too.

The whole error might look something like this: Continue reading

How to use the Azure AD associated with your SharePoint Online

Azure Active Directory (Azure AD)

With the usual configuration of Office 365 and Azure, there might be multiple Azure AD instances associated with your subscription. When creating registrations to whatever SharePoint-related apps that you might be using, if you create the registration to the wrong Azure AD, it can’t access the data in your SharePoint. Or at least without further configurations, it probably won’t get any data from your Office Graph API or whatever else you might want to use.  Continue reading

New version of Microsoft.IdentityModel.Clients.ActiveDirectory (ADAL.NET) is out – good time to update!

Mock Function call to force loading an assembly - how elegant!

 There’s now a new version of the assembly Microsoft.IdentityModel.Clients.ActiveDirectory available – plenty of reasons to update right away! Let me offer you one hot take on the matter.

Why bother updating?

In an earlier post I described an issue I had with Microsoft.IdentityModel.Clients.ActiveDirectory.Platform not getting copied during the build in a referencing project. In 3.17.0, which came out this month, the issue is fixed! The new package actually contains separate DLLs for different platforms.

In essence this means, that from C#/.NET -developer’s standing point, the team has assimilated the Microsoft.IdentityModel.Clients.ActiveDirectory.Platform assembly, among other platform DLLs, into Microsoft.IdentityModel.Clients.ActiveDirectory package itself. Hence, you’ll need no more funky hacks to ensure the DLLs get copied! 🙂

What’s new with Microsoft.IdentityModel.Clients.ActiveDirectory 3.17?

Continue reading

Using SharePoint Search Query Tool

SharePoint Search Query Tool

If you’re working on SharePoint deployments, and aren’t familiar with SharePoint Search Query Tool, you’re probably doing something wrong. Or you’ve gotten a really troublefree tenant and simple requirements.. 🙂 At least for technical issues, it’s the #1 tool for debugging what’s in the index and what isn’t. This blog post describes how to use it to investigate SharePoint Online Search index issues.

This blog post is about using SharePoint Search Query Tool to investigate search index issues in SharePoint Online. First of all, you can get the tool from here: https://sp2013searchtool.codeplex.com/.

Continue reading

Site Mailboxes deprecated on SharePoint Online – use Office Groups instead

Office Group

Microsoft is deprecating, or even removing one of the widely used features in SharePoint sites – Site Mailboxes. For the end-user this might no mean much, but still requires some additional work from the administration side. In this post, I’m trying to give a rough outline, on what you (as an administrator/content producer) should do.

So, what exactly is happening?

Continue reading

Remove-SPODeletedSite – Actually removing a SharePoint Online Site Collection

Delete site collection

This post describes the actual, working and fast process of removing a site collection in SharePoint Online using the Remove-SPODeletedSite commandlet in SharePoint Online Management Shell (a flavor of PowerShell).

Description

Sometimes you need to get rid of a site collection you’ve created in SharePoint Online. The most typical example perhap being removing the team site created for a group of people working together. That’s pretty simple and there are a few ways of doing that – namely, deleting the site from Site Settings or removing the site collection from SharePoint Administration. However, sometimes you need to recreate a new site using the same url as the one you removed – and that’s not going to be possible.

"Delete this site" on SharePoint Online

“Delete this site” on SharePoint Online

Delete site collection

Delete site collection on SharePoint Administration

Why is that, you ask?

Well, after you remove the site collection, it actually goes to the recycle bin. The bad thing is, that this recycle bin is NOT accessible using web browser, but only by PowerShell. SharePoint Online still reservers that url for the site, though, so you can’t create a new one with the same url!

Continue reading

Launching a new debugger instance from code in Visual Studio

Sequence contains more than one element

This post describes a quick solution to launching a new Visual Studio instance for debugging the code. Where I’ve found this exceptionally useful, has been in debugging code-first migration’s (one of the ways for database initialiation in .NET) Seed-method. It is by default undebuggable, as when you are running Update-Database you can’t really use a -debug switch or anything, and there’s really no way to launch the debugger. Hence the best you can do is using -verbose to get more information.

However, if you actually want to see what is happening in the code, here’s the solution.

Continue reading

Using Dispatcher to update values in GUI elements from a background thread

System.InvalidOperationException'

Quick tip:
If you’re developing something like a WPF app and you’ll need to update values on the User Interface based on a long-running operation that runs in a background thread (like depicted here), you’ll probably need to use Dispatcher, or otherwise you’ll run into issues with the GUI elements being owned by another thread, and therefore forbidding access to them. This can result in an error like this:

Luckily, there’s a quick workaround available. Read on!

Cue the Dispatcher

Continue reading

Updating files in an App Part (SharePoint Add-in)

SharePoint_aint_broken

Luckily, SharePoint Add-ins (or App Parts, like they were called earlier) are slowly getting killed and rooted out of all the sites they once were deployed to – and I don’t think anyone’s going to miss them. However, as so often happens with legacy implementations, there will still be thousands of sites, where SharePoint administrators and developers will be responsible for maintaining and developing the solutions further. This will occasionally require updating app parts, which is a process that kind of sucks. Here I’ll try to simplify the process.

Problem(s)

Not all the files in an app part are updated during the deployment and upgrade of the app. This is difficult to debug and leads to new functionality or enhancements not being applied to the target system.

Continue reading