How do I use only password authentication?

217 views
Skip to first unread message

Jeff Bowman

unread,
Dec 16, 2014, 8:32:06 PM12/16/14
to play-si...@googlegroups.com
I don't want to use the other authentication providers, just trying to keep things simple. I have tried to implement silhouette based on the typesafe activator seed without the OAuth or other authentication methods, however, I'm getting the following when I run the application (everything compiles)

[ERROR] application - 

! @6kgjp9a14 - Internal server error, for (GET) [/] ->

play.api.Configuration$$anon$1: Configuration error[Cannot initialize the custom Global object (app.Global) (perhaps it's a wrong reference?)]
at play.api.Configuration$.play$api$Configuration$$configError(Configuration.scala:94) ~[play_2.11-2.3.4.jar:2.3.4]
at play.api.Configuration.reportError(Configuration.scala:743) ~[play_2.11-2.3.4.jar:2.3.4]
at play.api.WithDefaultGlobal$class.play$api$WithDefaultGlobal$$scalaGlobal(Application.scala:42) ~[play_2.11-2.3.4.jar:2.3.4]
at play.api.DefaultApplication.play$api$WithDefaultGlobal$$scalaGlobal$lzycompute(Application.scala:402) ~[play_2.11-2.3.4.jar:2.3.4]
at play.api.DefaultApplication.play$api$WithDefaultGlobal$$scalaGlobal(Application.scala:402) ~[play_2.11-2.3.4.jar:2.3.4]
Caused by: java.lang.ExceptionInInitializerError: null
at sun.misc.Unsafe.ensureClassInitialized(Native Method) ~[na:1.8.0_25]
at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:43) ~[na:1.8.0_25]
at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:142) ~[na:1.8.0_25]
at java.lang.reflect.Field.acquireFieldAccessor(Field.java:1082) ~[na:1.8.0_25]
at java.lang.reflect.Field.getFieldAccessor(Field.java:1063) ~[na:1.8.0_25]
Caused by: com.google.inject.CreationException: Unable to create injector, see the following errors:

1) No implementation for com.mohiva.play.silhouette.contrib.daos.DelegableAuthInfoDAO<com.mohiva.play.silhouette.core.providers.OAuth1Info> was bound.
  at utils.di.SilhouetteModule.provideAuthInfoService(SilhouetteModule.scala:92)

2) No implementation for com.mohiva.play.silhouette.contrib.daos.DelegableAuthInfoDAO<com.mohiva.play.silhouette.core.providers.OAuth2Info> was bound.
  at utils.di.SilhouetteModule.provideAuthInfoService(SilhouetteModule.scala:92)

2 errors
at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:448) ~[guice-4.0-beta5.jar:na]
at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:155) ~[guice-4.0-beta5.jar:na]
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107) ~[guice-4.0-beta5.jar:na]
at com.google.inject.Guice.createInjector(Guice.java:96) ~[guice-4.0-beta5.jar:na]
at com.google.inject.Guice.createInjector(Guice.java:73) ~[guice-4.0-beta5.jar:na]
[WARN] play - No application found at invoker init

I can appreciate the error is telling me that I need to bin something for OAuth1 and 2, but I don't want to. I don't want to implement something I have no intention of using. How do I get around this? 

Thanks! 
Jeff

Christian Kaps

unread,
Dec 17, 2014, 2:01:57 AM12/17/14
to play-si...@googlegroups.com
Hi Jeff,

you have configured Guice to wire the AuthInfoService with the DelegableAuthInfoDAO[OAuth1Info] and DelegableAuthInfoDAO[OAuth2Info]. This must be removed.

Best regards,
Christian

Jeff Bowman

unread,
Dec 17, 2014, 10:25:40 AM12/17/14
to play-si...@googlegroups.com
Wow, that was simple! Thanks Christian!! Now I can't log into my app... but that was expected, so it works now.

Much appreciated!
Jeff

Jeff Bowman

unread,
Dec 31, 2014, 12:34:01 AM12/31/14
to play-si...@googlegroups.com
Still can't login to the application, but I'm getting an error I don't expect see this gist for my code and log info. Basically the key exists in the hashmap, but I still get an AuthenticationException - Couldn't find user

Thanks for your help!

Jeff

Christian Kaps

unread,
Dec 31, 2014, 1:19:16 AM12/31/14
to play-si...@googlegroups.com
Hi,

your user service must also return a user for the login info.


Best regards,
Christian
Reply all
Reply to author
Forward
0 new messages