Skip to content

murator/play-basic-authentication-filter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basic Athentication Filter

A simple Play Framework filter that provides basic authentication

Installing

resolvers += resolvers += "Rhinofly Internal Repository" at "http://maven-repository.rhinofly.net:8081/artifactory/libs-release-local"

libraryDependencies += "nl.rhinofly" %% "play-basic-authentication-filter" % "0.1"

Global.scala

import nl.rhinofly.basicAuthentication.BasicAuthenticationFilter

object Global extends WithFilters(BasicAuthenticationFilter()) with GlobalSettings

Configuration

The filter can be configured in different ways.

enabled

If set to false, the filter does not do anything.

// default: true
basicAuthentication.enabled=false

realm

This is the realm to which the security applies. Most browsers display it in the dialog.

// default: Application
basicAuthentication.realm="My Special Realm"

username and password

These are the credentials that are checked. If you do not specify them, the realm is set to a value indicating that and it defaults to a random universal unique identifier for both username and password.

// default: random uuid
basicAuthentication.username=username
basicAuthentication.password=password

Releasing

Make sure you have the correct credentials present (in ~/.sbt/0.13/credentials.sbt)

credentials += Credentials(Path.userHome / ".ivy2" / ".credentials") 

Then in the sbt console type release

About

Basic Authentication Filter for the Play Framework

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Scala 100.0%