adal

Microsoft Graph 401 Unauthorized with access token

孤人 提交于 2019-12-11 07:29:18
问题 Unable to get data from the the Microsoft Graph API. private String getUserNamesFromGraph() throws Exception { String bearerToken = "Bearer "+getAccessToken(); String url = "https://graph.microsoft.com/v1.0/users"; String returnData = null; try { URL apiURL = new URL(url); URLConnection con = apiURL.openConnection(); con.setRequestProperty("Authorization", bearerToken); con.setRequestProperty("Content-Type", "application/json"); BufferedReader in = new BufferedReader(new InputStreamReader(con

ADAL iOS - Different user was authenticated. Expected userA@mydomain.com, actual userB@mydomain.com

半世苍凉 提交于 2019-12-11 07:09:24
问题 I am using ADALiOS to access OneDrive for business service, and I use below snippet to authenticate a user after account disambiguation, ADAuthenticationContext *context = .... [context acquireTokenWithResource:resource clientId:clientId redirectUri:redirectUri promptBehavior:AD_PROMPT_ALWAYS userId:@"userA@mydomain.com" extraQueryParameters:@"" completionBlock:^(ADAuthenticationResult *result) { ... } The web authentication UI will prompt, and allow user to input credential to continue. The

Cannot renew access token from B2C, error AADB2C90077

為{幸葍}努か 提交于 2019-12-11 06:58:31
问题 I am experiencing issue trying to obtain a new access token from my AD B2C. From my SPA I use the MSAL.js library (v0.1.3) to authenticate to my AD B2C. After an hour, the access token expires so I do a silent token renew procedure but it fails. I use the following link to get a new access token: https://login.microsoftonline.com/te/myApp.onmicrosoft.com/b2c_1_signin/oauth2/v2.0/authorize?response_type=token&scope=https%3A%2F%2FmyApp.onmicrosoft.com%2Fapi%2Faccount.read%20openid%20profile

AngularJS SPA access CORS WebAPI secured on Azure AD

妖精的绣舞 提交于 2019-12-11 06:57:13
问题 I followed the example SinglePageApp-DotNet and it worked fine. Then I want to make the single page application to call a CORS enable web api. Both applications are secured by AAD and deployed to Azure websites, I can't make it work. I followed the examples of https://github.com/omercs/corsapisample and https://github.com/matvelloso/AngularJSCORS to every words, but I got 'Authorization has been denied for this request' error. When I disabled the [Authorize] attribute for the controller

Revoke consent using Azure v2.0

强颜欢笑 提交于 2019-12-11 05:32:27
问题 I am using Azure v2.0 for user authentication. The access token that I receive is used to fetch onenote content using microsoft graph api. And I do store refresh token at my end to access content on behalf of user at any time. Now user opt's out of my system I want to revoke the permissions given by user to my app. How I can revoke the access without depending on user for that. User may not manually go and revoke the permissions. Is there any api provided for same purpose. Is there any api

How to wait return statement if subscriber not completed in angular 2/4/6

老子叫甜甜 提交于 2019-12-11 05:30:39
问题 Currently I am working on the Angular6 project, and I have auth-http-interceptor. The problem in this file is that I want to get refresh token/acquire token from angular4-adal service every time, and for that, I have to subscribe the acquire token which will give the token and then want to assign that token in authReq object. But my intercept method's return type is Observable. Then how could I wait for subscribing the acquire token and then return next.handle(authReq). I have tried to write

ADAL js does not work in IE when acquiring token for remote endpoint when website url is added to “Trusted Sites”

≯℡__Kan透↙ 提交于 2019-12-11 02:18:18
问题 I submitted a bug for ADAL js project (https://github.com/AzureAD/azure-activedirectory-library-for-js/issues/102) but would like to check with the community - maybe someone has insight on why it is so. Title pretty much says it all: ADAL js does not work in IE when acquiring token for remote endpoint when website URL is added to "Trusted Sites". I created two test webapps: webapp and webapi and published to Azure websites. These samples are based on https://github.com/AzureAD/azure

Azure active directory Logout or clear token cache for native app

≯℡__Kan透↙ 提交于 2019-12-11 00:58:01
问题 I have a C# web API REST services back-end, I provide services for a CMS, a web page, and Angular2 app (this is the relevant here). The Angular app needs authenticate through the back-end sending username and password (raw credentials), the backend uses these to request an access_token to Azure Active Directory (with UserCredentials ), and sends the access_token back to the Angular app, to be used for authorization in it's requests ( Authorization: Bearer ). This is the way I'm authenticating

Azure API Apps Access Token (ADAL) not working

不问归期 提交于 2019-12-11 00:56:11
问题 I've created an API (Azure API App) and have enabled authentication/authtorization using Azure Active Directory (from the APP API . The app service is registered in AAD and everything looks good so far. I've followed the steps in the the post below to generate a token, but the token does not seem to work. var authContext = new AuthenticationContext("https://login.microsoftonline.com/<guid>/oauth2/authorize"); var credential = new ClientCredential("<clientId>", "<secret_from_aad>"); var result

How can I perform unattended oauth / openid authentication to WebAPI?

点点圈 提交于 2019-12-10 18:13:53
问题 Imagine a client and service application registered in Windows Azure. The client is a console and runs unattended on-premise (e.g. performing tests overnight) The service is a WebAPI service protected by oAuth and normally accessed using OpenID Connect, hosted in Azure. How can the client authenticate to the service WITHOUT any sort of user login interaction (i.e. the app authenticates itself to the service using ADAL .Net)? I tried the ADAL .Net Daemon to WebAPI sample but it still pops up