how to get user profile with azure ad in flutter - azure

how can I retrieve current user profile from an azure ad in flutter mobile app
I have used this flutter package and followed the example(not b2c). I can only retrieve the Access Token but not the user data like email and user names.
Is there anyone who got this?

Not familiar with Flutter but to get the information about a user, you will need to use Microsoft Graph API.
I searched for Microsoft Graph using this link: https://pub.dev/packages?q=microsoft+graph and it showed me some packages. Hopefully you should be able to pick the right package.

Related

Flutter Login using Azure Active directory

I am using Flutter for our Mobile application. and I am having trouble with Login user and get Auth token.
I have tried https://medium.com/flutter-community/flutter-azure-authentication-with-ad-b2c-8b76c81dd48e this article approach. My AAD is B2B. But after logged in I get a error in pop up:
Cannot GET /auth/openid/return
Any suggestion or article, documentation would be helpful.
Currently there is no native SDK for Flutter to integrate with Azure AD.
There is already a similar User voice.. You can vote for it or else you can create a new one.
I have used a pub.dev/packages/aad_oauth#-readme-tab this package to get acces token.
Even tough My app service was not b2c, I could successfully logged in and log out.

Microsoft bot emulator azure AD oauth does not give options to select the account to log in

I developed a bot with microsoft bot framework nodejs version4. I used azure AD oauth connection for the bot authentication. Initially when I try to login it shows me list of account to authenticate, but now it shows the empty window and does not allow me to select the account, by default it selects recent logged in account.
I does not know why this happens.Need help to solve
It sounds like you're having two issues.
First, you say you're getting a blank sign-in screen in Emulator. Bot Framework Emulator 4.4.1 has a bug involving OAuth cards: https://github.com/microsoft/BotFramework-Emulator/issues/1544
Try configuring Emulator to use a magic code:
Second, you say Skype is using a previously signed-in account. Please refer to the samples in order to see how to sign a user out.
const botAdapter = innerDc.context.adapter;
await botAdapter.signOutUser(innerDc.context, this.connectionName);

User.ReadWrite Permissions in Azure AD

I'm developing an application that incorporates the Skype for Business Online Web SDK. I've noticed that it is not possible to access information about the signed in user's Skype account/profile (via Skype's mePerson object).
The only way that I see to do this now is by having yourself as a contact and accessing information about that account/profile, via the Skype person object. This doesn't seem possible to me as it isn't feasible to set a requirement upon every client using my application to have themselves added as a contact on Skype for Business.
This issue is related to the one posted here, on the GitHub Skype Web SDK Samples page: https://github.com/OfficeDev/skype-web-sdk-samples/issues/1
My question: Are there plans to add the User.ReadWrite Permissions in Azure AD for an application extending Skype for Business? Or, is there a known workaround to retrieve the signed in user's profile/account information, which includes status, activity, or avatar/avatarUrl?
I've also posted this on the Microsoft Azure forums:
https://social.msdn.microsoft.com/Forums/azure/en-US/27d6ebdc-f023-4829-96dd-eefb9e1aaeaf/userreadwrite-permissions-in-azure-ad?forum=SkypeWebSDK
However, I've had no response so I'm also posting here in hopes of anybody having any input. Thank you in advance.
As you might have noticed from the issue link in GitHub, the permissions for the information you're trying to grab have been turned on in Azure AD.
You can plug in your Azure AD settings into the Interactive Web SDK to see it in action: https://ucwa.skype.com/websdk
Before you sign in, you'll need to do the following in the Azure AD management console:
Update your app to use the permissions in the image
Change your app's reply URL to this: https://ucwa.skype.com/websdk
Make sure you turn on OAuth implicit flow by modifying your app's manifest. Steps here https://msdn.microsoft.com/en-us/library/office/mt622687%28v=office.16%29.aspx?f=255&MSPPError=-2147217396 under "Configure your app for OAuth implicit grant flow"
Paste your app's Azure client ID into the "Client id" field on https://ucwa.skype.com/websdk
After you sign in, you'll notice one of the examples in the left hand navigation will let you view the signed-in user's presence, ID, etc.
I've also created a forked version of the Web SDK samples that you can easily update with your own Azure AD settings and deploy to your localhost. You might find this more useful for playing around than the hosted Interactive Web SDK.
https://github.com/tamhinsf/skype-web-sdk-samples

OAuth2 and Microsoft Graph API for my Node.js app?

I'd like to add an Office365/Graph Calendar integration to an existing Node.js app (hosted on AWS). I've already done a similar integration with Google's Calendar, and it was trivial to get set up. I'm not having nearly as much luck with the Microsoft version of things.
I've found at least 4 different ways to register an app (get a clientId and clientSecret), and I seem to get different errors for each of them, but can't get any to work properly.
I think a large part of my problem is that I've never had to work in the MS ecosystem before, so I don't have a lot of the baseline knowledge that the documentation assumes.
I'm not looking to host anything with Microsoft - do I even need an Azure account?
I'd like to allow any user with an Office365 account to connect it to my app - do I need to learn about Active Directory to do this? Does this part of it require Azure?
I've found instructions for using both https://login.microsoftonline.com/common/oauth2 and https://login.microsoftonline.com/common/oauth2/v2.0 for this, do I need to worry about which version I use depending on how I registered my app?
Microsoft Graph leverage Azure AD to authenticate and authorize users. The doc refers as:
To get your app authorized, you must get the user authenticated first. You do this by redirecting the user to the Azure Active Directory (Azure AD) authorization endpoint, along with your app information, to sign in to their Office 365 account. Once the user is signed in, and consents to the permissions requested by your app (if the user has not done so already), your app will receive an authorization code required to acquire an OAuth access token.
So you need to register an Azure account for configure the Azure AD service. Refer https://graph.microsoft.io/en-us/docs/authorization/app_authorization for more info.
Meanwhile, to implement Microsoft Graph in node.js application, you can refer the following code sample for your information.
Microsoft Graph service app sample using Node.js
An Office 365 API sample app using Node, Express and Ejs
Office 365 Node.js Connect sample using Microsoft Graph
Matt, you can do this without an Azure account if you use the oauth2/v2.0 auth endpoint. When you do that, you can register on apps.dev.microsoft.com using a Microsoft account.
See this tutorial for doing it with the Outlook REST API, which is similar to the Graph (in fact, for Calendar operations the calls and entities are identical).

steps to create App in Microsoft account

I am trying to create an App in Microsoft account, but really struggling to get a proper links / steps etc. After research I found this link: http://azure.microsoft.com/en-us/documentation/articles/mobile-services-how-to-register-microsoft-authentication/, but it's not giving "DashBoard" option after successful login to Microsoft account, so that I can register an App.
I need to register "App" there to get AppID and Client Secret, so that I will be used these details for authentication in for Apache Oltu Spring OAuth2 example.
Also I got the
AUTHORIZATION_URL = https://login.live.com/oauth20_authorize.srf
TOKEN LOCATION = https://login.live.com/oauth20_token.srf
The screen I am getting after login into microsoft account, I don't see dashboard to register App.
Could anyone please provide steps to create App in Microsoft account?
You can try https://account.live.com/developers/applications/index. This is used for Non-Windows store apps. If you're looking to register a Windows store app you will need to register as an app developer at https://dev.windows.com/en-us/programs/join.
The article you referenced includes the link for non-Windows store apps

Resources