securesocial

Unit-testing methods secured with Securesocial annotation

故事扮演 提交于 2019-12-02 13:19:57
问题 I'm trying to make some functional tests for my webapplication that is using Play 2.1.4 and Socialsecure. Before using securesocial the tests where pretty straight forward but now im having troubles figuering out how i can make tests on the secured actions. @Test public void createNewNote() { Result result; // Should return bad request if no data is given result = callAction( controllers.routes.ref.Notes.newNote(), fakeRequest().withFormUrlEncodedBody( ImmutableMap.of("title", "", "text", "")

Unit-testing methods secured with Securesocial annotation

拜拜、爱过 提交于 2019-12-02 07:17:39
I'm trying to make some functional tests for my webapplication that is using Play 2.1.4 and Socialsecure. Before using securesocial the tests where pretty straight forward but now im having troubles figuering out how i can make tests on the secured actions. @Test public void createNewNote() { Result result; // Should return bad request if no data is given result = callAction( controllers.routes.ref.Notes.newNote(), fakeRequest().withFormUrlEncodedBody( ImmutableMap.of("title", "", "text", ""))); assertThat(status(result)).isEqualTo(BAD_REQUEST); result = callAction( controllers.routes.ref

How do you run the SecureSocial demo?

≡放荡痞女 提交于 2019-12-01 08:45:46
I downloaded securesocial-master.zip from https://github.com/jaliss/securesocial/tree/master 1.After extracting, change directory cd C:\Users\ddd\play\securesocial-master 2.run activator C:\Users\ddd\play\securesocial-master\activator run The Error message: C:\Users\DDD\workspace\securesocial-master>activator run [info] Loading project definition from C:\Users\DDD\workspace\securesocial-m aster\project [info] Set current project to SecureSocial-parent (in build file:/C:/Users/DDD /workspace/securesocial-master/) [info] Updating {file:/C:/Users/DDD/workspace/securesocial-master/}root... [info]

How do you run the SecureSocial demo?

浪子不回头ぞ 提交于 2019-12-01 06:58:59
问题 I downloaded securesocial-master.zip from https://github.com/jaliss/securesocial/tree/master 1.After extracting, change directory cd C:\Users\ddd\play\securesocial-master 2.run activator C:\Users\ddd\play\securesocial-master\activator run The Error message: C:\Users\DDD\workspace\securesocial-master>activator run [info] Loading project definition from C:\Users\DDD\workspace\securesocial-m aster\project [info] Set current project to SecureSocial-parent (in build file:/C:/Users/DDD /workspace

securesocial fake log in when developing

谁都会走 提交于 2019-11-30 21:21:25
I am using securesocial it works fine but now every time I change some scala code I have to login again. Is there a possibility to fake a user in the session when in development mode, so I don't have to login so often? Thanks, Joris Wijlens That happens because in DEV mode Play restarts the app when you change your code. So, the data in the sample user service is lost. SecureSocial by default uses the default Play cache for storing authenticators (that match the cookies to the logged in user). The default play cache is EHCache and it's configured using the ehcache.xml that you can find in the

securesocial fake log in when developing

柔情痞子 提交于 2019-11-30 17:10:51
问题 I am using securesocial it works fine but now every time I change some scala code I have to login again. Is there a possibility to fake a user in the session when in development mode, so I don't have to login so often? Thanks, Joris Wijlens 回答1: That happens because in DEV mode Play restarts the app when you change your code. So, the data in the sample user service is lost. 回答2: SecureSocial by default uses the default Play cache for storing authenticators (that match the cookies to the

Testing a Play2 application with SecureSocial using dependency injection

一世执手 提交于 2019-11-29 05:14:26
Thanks a lot for any guidance! The SecureSocial plugin works fine when I run it from the browser, but I would like to be able to test the rest of my Play app now. Quick Intro SecureSocial's syntax looks like this: def page = SecuredAction(WithProvider("google")) { ... } or this: def page = UserAwareAction { ... } I've been looking here , which seems to be the only question on Stack Overflow even remotely related to my problem with SecureSocial, but I don't quite fancy rewiring bytecode. There should be a simpler solution to this. When I'm running tests that access SecureSocial-protected

Expose Play Framework rest calls secured via securesocial to mobile app

你。 提交于 2019-11-28 17:07:23
I would like to expose my Play Framework REST calls to clients other than my play app. I would like a mobile app to call those secured rest calls. I asked a question on SO earlier in the year and got an answer but this only works for OAuth2 and I am only using OAuth1 My questions are: Is exposing my REST calls secured by Securesocial on my PlayFramework app to non web clients like Mobile apps a good idea? Is there a way to do this using Securesocial for OAuth1? Are there any examples apart from the one in the link from my last question? Latest changes in master-SNAPSHOT include a LoginApi

Expose Play Framework rest calls secured via securesocial to mobile app

我与影子孤独终老i 提交于 2019-11-27 10:11:48
问题 I would like to expose my Play Framework REST calls to clients other than my play app. I would like a mobile app to call those secured rest calls. I asked a question on SO earlier in the year and got an answer but this only works for OAuth2 and I am only using OAuth1 My questions are: Is exposing my REST calls secured by Securesocial on my PlayFramework app to non web clients like Mobile apps a good idea? Is there a way to do this using Securesocial for OAuth1? Are there any examples apart