Comments (4)
@IpsitoDutta - I found the reason the interactive login wasn't working was the Azure AD app registration had the incorrect redirect URL. We were originally using localhost but when we change it to https://login.microsoftonline.com/common/oauth2/nativeclient then it worked as expected.
from msal.ps.
I am not sure why the behavior would be different between versions unless there is a difference in how the MSAL.net library works in .NET Framework vs Core but that does not appear to be the issue here.
If you follow the instructions in the error message you should be able to resolve this by making your app registration a public client. You are requesting a token for a public client, not a confidential client, because you are not providing an app secret or certificate as part of the authentication.
https://aka.ms/msal-net-invalid-client
from msal.ps.
So an update. I did have the redirect URI, but the platform chosen was web. After changing the platform to Mobile/Desktop app, I'm able to get the token issued but Yammer is still not accepting it. I am looking into it.
from msal.ps.
Final update: After changing the platform to Mobile/Desktop and using the script below, I am able to call Yammer Rest APIs after a successful interactive auth:
$TenantId=''
$ClientId=''
$Scopes=@('https://api.yammer.com/.default')
$token=Get-MsalToken -TenantId $TenantId -ClientId $ClientId -Scopes $Scopes -Interactive
$Bearertoken="Bearer " + $token.Accesstoken
$headers = @{Authorization=$Bearertoken}
$response=Invoke-RestMethod -Method Get -Uri "https://www.yammer.com/api/v1/users/current.jsonβ -Headers $headers
$response
Thank you for pointing me in the right direction. @muzzar78
from msal.ps.
Related Issues (20)
- IntegratedWindowsAuth example? HOT 4
- MSAL token provided only works with MS Graph HOT 1
- Support WAM as an Authentication Method
- Get-MsalToken fails to launch interactive authentication prompt from Windows Terminal HOT 4
- replace load of PS1 files in psd1 by a main psm1 loading the ps1 HOT 3
- -Scope or -Scopes? HOT 1
- Import Module fails when home./config is not present HOT 1
- Missing Get-MsalToken in version 4.37.0.0 HOT 1
- New-MsalClientApplication : Cannot convert argument "builder" HOT 4
- MSAL.PS in Azure Automation with 7.2 Runbook
- Get-MsalToken fails for some users, references a .NET in error message. HOT 3
- New-MsalClientApplication : Cannot convert argument "builder" HOT 4
- "Microsoft.Identity.Client.dll" conflicts w/same assembly from ExchangeOnlineManagement module HOT 3
- I get this error with Select-MsalClientApplication.ps1
- Import-Module MSAL.PS retrieve errors
- Primary refresh token missing in WebView2, unable to authenticate HOT 4
- Import-Module : Could not load file or assembly 'file:///C:\Program Files\WindowsPowerShell\Modules\MSAL.PS\4.37.0.0\Microsoft.Identity.Client.4.37.0\net45\Microsoft.Identity.Client.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
- Use with different ResourceUri's? HOT 2
- Unable to convert .cert file to type X509Certificates.X509Certificate2
- Version of Microsoft.Identity.Client is significantly dated
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from msal.ps.