Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^6: Need to resolve the API call query

by davido (Cardinal)
on Jun 09, 2021 at 22:03 UTC ( [id://11133707]=note: print w/replies, xml ) Need Help??


in reply to Re^5: Need to resolve the API call query
in thread Need to resolve the API call query

The module is a bad choice for the following reasons:

  • Plack::Middleware::OAuth has not received an update in almost ten years.
  • The module's POD says: "This module is still in **BETA** , DO NOT USE THIS FOR PRODUCTION!"
  • The module has open issues that are ten years old. No recent issues. None of the issues have been addressed. So it is not in good working order, and not getting fixed.
  • The module author hasn't posted anything to CPAN in almost eight years.

The module author tells you in the documentation not to use the module. It wouldn't be productive to try to find an author who has been absent for eight years, to ask questions or to ask for bug-fixes in a module that has been marked "beta" for a decade.

If it were me, I would investigate other OAuth modules and choose one that is actively maintained.


Dave

  • Comment on Re^6: Need to resolve the API call query

Replies are listed 'Best First'.
Re^7: Need to resolve the API call query
by chandantul (Scribe) on Jun 10, 2021 at 22:52 UTC

    Hi Dave,Thanks for your kind responses. I have contacted the author and fork the module from github and made possible to redirect to our OKTA authorization page by modifying ReuestTokenV2.pm. Please check below code snippet that made it possible but one thing how can i capture the headers query string parameter from browser

    My main goal is to capture the query string parameter "code" in order to get the value and utlize the same to get the access_token from our OKTA authorization server. I am trying to code sub function in my OP.pm, I was wondering i could utlize the HTTP request in same

    app.psgi

    use strict; use warnings; use Plack::Middleware; use Plack::Middleware::OAuth; use Plack::Middleware::OAuth::dev; use URI; use LWP::UserAgent; use Plack::Builder; use Plack::Middleware; use Authen::Simple::ActiveDirectory; use Log::Log4perl; builder {enable 'OAuth', on_success => => sub { my ($self,$token) = @_; my $userinfo = Plack::Middleware::OAuth::UserInfo->new( config +=> $self->config , token => $token ); if( $token->is_provider('Dev') ) { my $info = $userinfo->ask( $token->provider ); return $self->to_yaml( $info ); } return $self->render( 'Error' ); }, providers => { 'Dev' => { client_id => 'xxxxxxxxxxxxxxxxxxx', client_secret => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxx' }, }; webapp->to_app; };

    Please check below config dev.pm

    package Plack::Middleware::OAuth::dev; use warnings; use strict; sub config { + { version => 2, authorize_url => 'https://dev.oktapreview.com/oauth2/v1/authori +ze', access_token_url => 'https://dev.oktapreview.com/oauth2/v1/token', response_type => 'code', redirect_uri => 'https://testchandan.com:5001', grant_type => 'authorization_code', scope => 'openid', state => '1234', } } 1;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11133707]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (1)
As of 2024-04-18 23:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found