play-authenticate-usage-scala | Scala version of the usage sample | Learning library
kandi X-RAY | play-authenticate-usage-scala Summary
kandi X-RAY | play-authenticate-usage-scala Summary
Scala version of the usage sample of
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of play-authenticate-usage-scala
play-authenticate-usage-scala Key Features
play-authenticate-usage-scala Examples and Code Snippets
Community Discussions
Trending Discussions on play-authenticate-usage-scala
QUESTION
What I'm asking is how to get hold of the Default Scala Play BodyParser
implementation in 2.6. However, if you know a cleaner way to solve this use-case I'm more than happy to hear it.
Some preamble ... I reused a Java Play framework Play-Authenticate (PA) to build a Scala Play application on top. Yes crucify me for it! I wanted all the social authentication functionality but have my application in Scala and use e.g. Slick. Yes yes I could try rewriting PA in Scala but no time now ... thinking about it though.
Now that this is out of the way, here is my use case. I have Scala controllers and need to pass Java Context to the PA framework to be able to use it. I also need to check whether the user can be cookie-authenticated, namely whether the user checked the "Remember Me" box when she logged the first time. This "solution" used to work before migrating to Play 2.6 but now doesn't work because of the BodyParser
.
This is what the "burger" looks like. I want to eat it so ... I need to authenticate the user by checking the incoming cookie but while at it a Java Context is created (to interoperate with PA). But since I have the dreaded Java Context I can make it available throughout the Scala Application in the scope of one request:
...ANSWER
Answered 2019-May-10 at 12:08I found a solution or potentially the solution?
First by changing the object WithJContextSupportAction
's apply
method to include play.api.mvc.PlayBodyParsers
as implicit parameter:
QUESTION
I have a simplified version of a Controller that looks like this (see the full file here):
...ANSWER
Answered 2019-May-08 at 16:57Messages
docs state that
...you can wrap a given
Lang
together with theMessagesApi
to create aplay.api.i18n.Messages
instance.
so consider refactoring views to take
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install play-authenticate-usage-scala
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page