Re: [Mojolicious] Re: struggling with OAuth(2) from google

2019-04-16 Thread ivo welch
Yes.  I thought it was used automatically.  The error message suggests that
OAuth2 is the source of the problem.


On Tue, Apr 16, 2019, 7:03 AM Jan Henning Thorsen 
wrote:

> Have you tried https://metacpan.org/pod/Mojolicious::Plugin::OAuth2 ?
>
>
> On Tuesday, April 16, 2019 at 7:48:41 AM UTC+7, iwe...@g.ucla.edu wrote:
>>
>>
>> dear M experts.  I am again struggling with the OAuth module.  this is
>> perhaps because I installed a new ubuntu 18.04.2 machine, and then updated
>> Mojolicious to the current version.
>>
>> first, for anyone else struggling, Mojolicious::Plugin::Web::Auth
>> depends on Net::SSLeay, which fails installing.  I believe I fixed this
>> by installing `apt install libssl-dev libz-dev`.  I know this is not M's
>> fault, but I would suggest that the Auth author stop the install with a
>> good instructive error message when these two libraries are not detected.
>> grrr
>>
>>
>> second, my M code is still the same as before, but now it is dying with a
>> non-informative error message at the point where I had hoped to get my
>> Google authentication callback:
>>
>> *Can't locate object method "headers" via package "1" (perhaps you forgot
>> to load "1"?) at
>> /usr/local/share/perl/5.26.1/Mojolicious/Plugin/Web/Auth/OAuth2.pm line
>> 122.*
>>
>> I believe the callback I am getting from google is:
>>
>> *http://auth.syllabus.space/auth/google/callback?state=hashcode=hashcode=email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+openid=0=g.ucla.edu_state=hashcodes=none
>> *
>>
>> I am guessing that google encodes the email address in one of the hash
>> codes (which I have blanked here).
>>
>> my relevant (I think) code excerpt that should be called is
>>
>> package SylSpace::Controller::AuthAuthenticator;
>> use Mojolicious::Lite;
>>
>> sub google {
>>   my ( $self, $access_token, $userinfo ) = @_;
>>   my $name = $userinfo->{displayName} || $userinfo->{name};
>>   my $email= $userinfo->{email};
>>
>>   (defined($email)) or die "no good email.";
>>
>>   return logandreturn( $self, $email, $name, 'google' );
>> }
>>
>> looking at the code, the error comes from
>>
>> (my $res = $tx->result->is_success ) or do {
>> return $callback->{on_error}->( $tx->res->body );
>> };
>>
>> my $dat = $self->_response_to_hash($res);
>>
>> ...
>>
>> my $exts = $types->detect( $res->headers->content_type );
>>
>> could someone please help me?  what could have gone wrong here?
>>
>>
>> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to mojolicious@googlegroups.com.
> Visit this group at https://groups.google.com/group/mojolicious.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.


Re: [Mojolicious] M-Lite pre app->start domain?

2017-05-07 Thread ivo welch
On Sun, May 7, 2017 at 8:20 AM, Stefan Adams <s1037...@gmail.com> wrote:

> Hmm...  I wonder if the best way to do this is with mode
> <http://mojolicious.org/perldoc/Mojolicious#mode>.  I assume you listen
> on localhost when in development mode, and on a real host you're in
> production mode.
>


​duh...this is obviously the correct solution.  thank you stefan.  regards,
/iaw
​




Ivo Welch (ivo.we...@gmail.com)
http://www.ivo-welch.info/
J. Fred Weston Distinguished Professor of Finance
Anderson School at UCLA, C524
Free Finance Textbook, http://book.ivo-welch.info/
Exec Editor, Critical Finance Review,
http://www.critical-finance-review.org/

[if this is the first email in a conversation, please acknowledge receipt
to deal with automated spam filters]

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.


Re: [Mojolicious] M-Lite pre app->start domain?

2017-05-06 Thread ivo welch
>
> Mojo servers don't run / listen on a domain -- they listen on IPs.  As
> such, it'll respond to whatever domain is pointed to the IP that routes to
> your Mojo server.  So no, I don't think you can determine the domain before
> you start your app.
>

​ok.  can I get the IP?  all I need is learn whether I am operating on
127.0.0.1 (or port 3000).

I don't understand.  We talked about this in another thread.  What's the
> issue?
>

because of browser buglets when localhost has subdomains.  when localhost,
I must not set cookie_domain before the app starts.  when I am on listening
on a real host, I want to set it.

regards, /iaw

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.


Re: [Mojolicious] Mojolyst Bug

2017-04-24 Thread ivo welch
hi stefan---at least I can independently betatest it.  I will do so
tomorrow.  regards, /iaw



Ivo Welch (ivo.we...@gmail.com)
http://www.ivo-welch.info/
J. Fred Weston Distinguished Professor of Finance
Anderson School at UCLA, C524
Free Finance Textbook, http://book.ivo-welch.info/
Exec Editor, Critical Finance Review,
http://www.critical-finance-review.org/
Editor and Publisher, FAMe, http://www.fame-jagazine.com/

On Mon, Apr 24, 2017 at 1:19 PM, Stefan Adams <s1037...@gmail.com> wrote:

>
> On Mon, Apr 24, 2017 at 12:18 PM, sri <kra...@gmail.com> wrote:
>
>> Perhaps sri wouldn't mind if you packaged up his code and released it to
>>> CPAN??
>>>
>>
>> Not at all.
>>
>
> Great!
>
> iaw, I have built a dist
> <https://github.com/s1037989/Mojolicious-Plugin-Mojolyst> and released it
> to CPAN (should be available in a few hours).  Hopefully I did it alright!
>  :O
>
> FYI, I think this is my full list of steps to create and ship this module
> to CPAN.  There are many ways to build a CPAN module including completely
> manually (in which case use Mojolicious' cpanify
> <http://mojolicious.org/perldoc/Mojolicious/Command/cpanify>), I prefer
> to use jhthorsen's App::git::ship
> <https://github.com/jhthorsen/app-git-ship>.
>
> $ cpanm App::git::ship
> $ $EDITOR ~/.pause
> <http://search.cpan.org/~rjbs/CPAN-Uploader-0.103013/lib/CPAN/Uploader.pm>
>
> user xxx
>
> password xxx
>
> $ mojo generate plugin
> <http://mojolicious.org/perldoc/Mojolicious/Command/generate/plugin>
> Mojolyst
> $ cd Mojolicious-Plugin-Mojolyst
> $ $EDITOR Mojolicious-Plugin-Mojolyst/lib/Mojolicious/Plugin/Mojolyst.pm
>
> ...
>
> $ $EDITOR t/basic.t
>
> ...
>
> $ $EDITOR .ship.conf
> <http://search.cpan.org/~jhthorsen/App-git-ship-0.22/lib/App/git/ship.pm#DESCRIPTION>
>
> class = App::git::ship::perl
> license = artistic_2
>
> $ $EDITOR cpanfile
> <http://search.cpan.org/~miyagawa/Module-CPANfile/lib/cpanfile.pod>
>
> requires "ExtUtils::MakeMaker" => "6.00";
> requires "Mojolicious" => "7.11";
>
> $ $EDITOR Changes
>
> 0.01 Not Released
>  - Initial release based on kraih's Mojolicious hack of the day: Mojolyst
>
> $ git init
> $ git add -A
> $ git commit -m "first commit"
> $ git remote add origin g...@github.com:s1037989/
> Mojolicious-Plugin-Mojolyst.git
> $ git push -u origin master
> $ git ship start
> $ git ship build
> $ git ship
>
>
>
> --
> 1:30
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Mojolicious" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/mojolicious/QnKyvYSoYI4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> mojolicious+unsubscr...@googlegroups.com.
> To post to this group, send email to mojolicious@googlegroups.com.
> Visit this group at https://groups.google.com/group/mojolicious.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.


Re: [Mojolicious] Mojolyst Bug

2017-04-24 Thread ivo welch
...except that I have never packed up anything and released to CPAN.  my
one module (regression) was packed up by someone else.  :-(   I tend to be
more efficient donating funds to a project than donating code.

regards,

/iaw



Ivo Welch (ivo.we...@gmail.com)
http://www.ivo-welch.info/
J. Fred Weston Distinguished Professor of Finance
Anderson School at UCLA, C524
Free Finance Textbook, http://book.ivo-welch.info/
Exec Editor, Critical Finance Review,
http://www.critical-finance-review.org/
Editor and Publisher, FAMe, http://www.fame-jagazine.com/

On Sun, Apr 23, 2017 at 9:28 PM, Stefan Adams <s1037...@gmail.com> wrote:

>
> On Sun, Apr 23, 2017 at 11:13 PM, ivo welch <ivo.we...@anderson.ucla.edu>
> wrote:
>
>> indeed---already fixed.  thank you.
>
>
> Great!  You bet!
>
>
>> does this updated Mojolyst plugin now live on cpan, too?
>
>
> No <http://search.cpan.org/search?query=mojolyst=all>.  :(
>
> Perhaps sri wouldn't mind if you packaged up his code and released it to
> CPAN??
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Mojolicious" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/mojolicious/QnKyvYSoYI4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> mojolicious+unsubscr...@googlegroups.com.
> To post to this group, send email to mojolicious@googlegroups.com.
> Visit this group at https://groups.google.com/group/mojolicious.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.


Re: [Mojolicious] Mojolyst Bug

2017-04-23 Thread ivo welch
indeed---already fixed.  thank you.  does this updated Mojolyst plugin now
live on cpan, too?

regards,

/iaw



Ivo Welch (ivo.we...@gmail.com)
http://www.ivo-welch.info/
J. Fred Weston Distinguished Professor of Finance
Anderson School at UCLA, C524
Free Finance Textbook, http://book.ivo-welch.info/
Exec Editor, Critical Finance Review,
http://www.critical-finance-review.org/
Editor and Publisher, FAMe, http://www.fame-jagazine.com/

On Sun, Apr 23, 2017 at 8:18 PM, Stefan Adams <s1037...@gmail.com> wrote:

> Sorry, what my comment was saying was to use my code for the plugin. Sri's
> code was pre-5.81. So open up your local Mojolyst.pm plugin and replace all
> the code with the code from my first comment.
>
> Let me know if you have any more questions!
>
> On Apr 23, 2017 9:35 PM, "iaw4" <ivo...@gmail.com> wrote:
>
>>
>> thanks, stefan.  I am not clear how I would code this simple example.
>>  could you please give me one?
>>
>> [ps: for the unsuspecting (like me), is there a way to throw an error or
>> warning?  I did spend an hour to trace the problem.]
>>
>> regards, /iaw
>>
>>
>> On Sunday, April 23, 2017 at 6:49:24 PM UTC-7, Stefan Adams wrote:
>>>
>>> Take a look at my comments at the bottom of the gist:
>>>
>>> https://gist.github.com/kraih/2149176#gistcomment-2045769
>>>
>>>>
>>>> --
>> 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+unsubscr...@googlegroups.com.
>> To post to this group, send email to mojolicious@googlegroups.com.
>> Visit this group at https://groups.google.com/group/mojolicious.
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Mojolicious" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/mojolicious/QnKyvYSoYI4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> mojolicious+unsubscr...@googlegroups.com.
> To post to this group, send email to mojolicious@googlegroups.com.
> Visit this group at https://groups.google.com/group/mojolicious.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.


Re: [Mojolicious] Re: use inside mojo templates

2017-04-03 Thread ivo welch
uhmmm...but it requires something more.  by itself, it does not work.  the
code complains that the plugin is not registered.



Ivo Welch (ivo.we...@gmail.com)
http://www.ivo-welch.info/
J. Fred Weston Distinguished Professor of Finance
Anderson School at UCLA, C524
Free Finance Textbook, http://book.ivo-welch.info/
Exec Editor, Critical Finance Review,
http://www.critical-finance-review.org/
Editor and Publisher, FAMe, http://www.fame-jagazine.com/

On Mon, Apr 3, 2017 at 9:29 PM, Stefan Adams <s...@adams.fm> wrote:

>
> On Mon, Apr 3, 2017 at 11:48 AM, sri <kra...@gmail.com> wrote:
>
>> Sounds like the Mojolyst hack i wrote a few years ago.
>>
>> http://blog.mojolicious.org/post/157278582436/mojolicious-
>> hack-of-the-day-mojolyst
>>
>
> You're right -- it does!  That's a super sweet hack!!
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Mojolicious" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/mojolicious/IaY8LtJaaes/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> mojolicious+unsubscr...@googlegroups.com.
> To post to this group, send email to mojolicious@googlegroups.com.
> Visit this group at https://groups.google.com/group/mojolicious.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.


Re: [Mojolicious] Re: use inside mojo templates

2017-04-03 Thread ivo welch
bless you.  alas, how does the plugin get installed?  I stuck all four
files into a directory, and tried

morbo myapp.pl

but

Can't load application from file "myapp.pl": Plugin "Mojolyst" missing,
maybe you need to install it?

it's not in the cpan list, either.  this would be a nice plugin to
distribute.

regards,

/iaw

Sounds like the Mojolyst hack i wrote a few years ago.
>
> http://blog.mojolicious.org/post/157278582436/mojolicious-
> hack-of-the-day-mojolyst
>
> --
> sebastian
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Mojolicious" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/mojolicious/IaY8LtJaaes/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> mojolicious+unsubscr...@googlegroups.com.
> To post to this group, send email to mojolicious@googlegroups.com.
> Visit this group at https://groups.google.com/group/mojolicious.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.