Giter VIP home page Giter VIP logo

azure-ad-auth's Issues

Doesn't work with AD Oauth2 2.0

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

Always getting unauthorized when trying to connect to my tenant

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.

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.