Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^18: Need to know the process to implement perl script into web application server.

by chandantul (Scribe)
on Jul 19, 2021 at 16:39 UTC ( [id://11135176]=note: print w/replies, xml ) Need Help??


in reply to Re^17: Need to know the process to implement perl script into web application server.
in thread Need to know the process to implement perl script into web application server.

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re^19: Need to know the process to implement perl script into web application server.
by choroba (Cardinal) on Jul 19, 2021 at 17:10 UTC
    > Its not taking

    What is not taking the email? Have you noticed it's an array reference? To get the value, you need to dereference it.

    Also, are you really not able to fix the indentation? Most editors can do it for you. The code will become much easier to read not only for us, but also for you.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

      Yes, Thanks, I have dereferenced the email and everything looks fine. but i would like to know if any one has worked on the Net::Oauth2::client. I will need to send multi values scopes instead of single valued scopes. Can you let me know if you have fixed this single values scopes vs multivalued scopes issues in Net::Oauth2:Client? I am getting 400 BAD request from authorization server. It does mean client unable to send required parameters to Authorization server.

      How can I use multi-values scopes in your Net::OAUTH2::Client? Below Subroutine is working fine.

      sub client ($){ $id = route_parameters->get('site_id'); $site_id = $id; #my $site_config = config->{sites}{$site_id} || {}; my $redirect = uri_for("/got/$site_id"); $redirect =~ s,/dispatch\.cgi,,; Net::OAuth2::Profile::WebServer->new( client_id => 'xxxxxxxxxxxxxxxxxxxxx', client_secret => 'xxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', authorize_url => 'https:// dev.oktapreview.com/oauth2 +/v1/authorize', access_token_url => 'https:// dev.oktapreview.com/oauth2 +/v1/token', response_type => 'code', grant_type => 'authorization_code', scope => 'okta.users.read', state => '1234', redirect_uri => $redirect );

      But below subroutines is not working but my requirement is to send multivalued as scope. Its throwing 400 BAD request.

      sub client ($){ $id = route_parameters->get('site_id'); $site_id = $id; #my $site_config = config->{sites}{$site_id} || {}; my $redirect = uri_for("/got/$site_id"); $redirect =~ s,/dispatch\.cgi,,; my @scopeval = ('okta.users.read', 'okta.apps.read'); Net::OAuth2::Profile::WebServer->new( client_id => 'xxxxxxxxxxxxxxxxxxxxxxxxxxx', client_secret => 'xxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxx', authorize_url => 'https:// dev.oktapreview.com/oauth2 +/v1/authorize', access_token_url => 'https://dev.oktapreview.com/oauth2/ +v1/token', response_type => 'code', grant_type => 'authorization_code', scope => @scopeval, state => '1234', redirect_uri => $redirect ); }
        Do you understand how list context works in Perl?

        my @scopeval = qw( okta.users.read alternative.auth ); my %args = (scope => @scopeval);

        This leads to

        Odd number of elements in hash assignment at ...

        map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
        A reply falls below the community's threshold of quality. You may see it by logging in.
Re^19: Need to know the process to implement perl script into web application server.
by karlgoethebier (Abbot) on Jul 19, 2021 at 18:52 UTC

    Make it so.

    «The Crux of the Biscuit is the Apostrophe»

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-03-29 15:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found