Giter VIP home page Giter VIP logo

Comments (4)

muzzar78 avatar muzzar78 commented on August 23, 2024 1

@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.

image

from msal.ps.

jazuntee avatar jazuntee commented on August 23, 2024

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.

IpsitoDutta avatar IpsitoDutta commented on August 23, 2024

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.

IpsitoDutta avatar IpsitoDutta commented on August 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.