pplu / azure-ad-auth Goto Github PK
View Code? Open in Web Editor NEWPerl libraries for authenticating through Azure AD
License: Other
Perl libraries for authenticating through Azure AD
License: Other
Have you been manually setting up permissions in Azure AD for the app? I created a new app registration in the Microsoft app portal, created the secret ID, app Id etc. Setup what permissions the app will require. But when connecting and getting a token I always get unauthorized when trying to connect to my tennant. If I try device login I just receive a portal login error in the browser about admin consent.
Any pointers would be appreciated.
I am using ClientCredentials. The application I am connecting to requires that we use v2.0 (token_endpoint => "https://login.microsoftonline.com/$tenant_id/oauth2/v2.0/token"). I can specify this as a parameter to the ClientCredentials call, but I get this error:
Exception with type: Remote: {"error":"invalid_request","error_description":"AADSTS901002: The 'resource' request parameter is not supported.\r\nTrace ID: 268cc3d4-d9f9-4ea3-82e0-9041bbb50f00\r\nCorrelation ID: 3b7150f3-79c3-4538-8b00-569e26dddcb8\r\nTimestamp: 2022-02-11 08:30:37Z","error_codes":[901002],"timestamp":"2022-02-11 08:30:37Z","trace_id":"268cc3d4-d9f9-4ea3-82e0-9041bbb50f00","correlation_id":"3b7150f3-79c3-4538-8b00-569e26dddcb8"} with HTTP status 400
It works if I send the scope as the resource_id and change the name of the value sent from resource to scope in this code:
my $auth_response = $self->ua->post_form(
$self->token_endpoint,
{
grant_type => 'client_credentials',
client_id => $self->client_id,
client_secret => $self->secret_id,
resource => $self->resource_id,
}
);
But then it doesn't work with v1 and I couldn't figure out a nice way to pass either scope or resource_id in order to provide a patch (I have never worked with Moo or Moose before).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.