Quick and not so dirty private-mode for play2 apps

Written by: Michael Neale

Developer Zone

1 min read

Stay connected

For some CloudBees containers (not all currently) - there is a private mode that you can turn on (for example when an app is in development, or only for a small group to use).

You can do this with Play! 2 via the Global settings and filters/interceptors:

https://github.com/michaelneale/play-private-mode/blob/master/app/controllers/Global.scala

All you need to so is copy that file into your controllers directory - and you are done.

To turn it on you run "bees config:set password=SECRETKEY " - it will then prompt for basic auth the next time you redeploy/restart the app - so you can keep your app private with a throw-away key (it ignores the user name in the current implementation - you can change that behaviour if you want).

We are also looking at ways to do openid/oauth type access control for apps - watch this space.

UPDATE: If you have an existing Global.java in your play project, you can still use this, as per https://groups.google.com/forum/?fromgroups=#!topic/play-framework/4lmK8V2_6QI (thanks to James Roper and google!)

Stay up to date

We'll never share your email address and you can opt out at any time, we promise.

Loading form...
Your ad blocker may be blocking functionality on this page. Please disable for an improved experience.