sub client ($){ $id = route_parameters->get('site_id'); $site_id = $id; my $redirect = uri_for("/got/$site_id"); $redirect =~ s,/dispatch\.cgi,,; my @scopeval = ('okta.users.read', 'okta.apps.read'); my $b = ( () = ('okta.users.read','okta.apps.read') ); my ($x,$y) = @scopeval; Net::OAuth2::Profile::WebServer->new ( client_id => 'xxxxxxxxxxxxxxxxxxxx', client_secret => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 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 => $x." ".$y, state => '1234', redirect_uri => $redirect ); }