Discussion:
Oauth password grant using the plugin
(too old to reply)
Nacho B
2018-09-03 16:32:56 UTC
Permalink
Hi,

I am trying to use Mojolicious as a backend for an Ember application. For
authentication, it seems that the way to go is Oauth2 Password Grant.

Examples in Mojolicious::Plugin::OAuth2::Server use the "Code Grant" flow.
And examples for the Ember front end documentation do not help very much
either.


Without the plugin I can *verify username and password *using
Net::OAuth2::AuthorizationServer::PasswordGrant

my ( $client_id,$error,$scopes,$username ) = $Grant->verify_user_password(
client_id => $client_id,
client_secret => $client_secret,
username => $client_data{username},
password => $client_data{password},
);
And I can *get the token* using:

my $token = $Grant->token(
client_id => $client_id,
scopes => $scopes_ref,
type => 'access', # one of: access, refresh
);
*But I do not know how to do the same using the plugin. Shouldn't it be
easier?*


I will appreciate any advice. I am suffering a lot with this project!!!!

Nacho B.
--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...