Skip to content

Simple BasicAuthenticator for Play-Framework-Apps (implemented as Filter)

License

Notifications You must be signed in to change notification settings

janjaali/playBasicAuthenticator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

playBasicAuthenticator

Simple BasicAuthentication for Play-Framework-Apps (implemented as Filter).

usage

  1. Add as dependecy to your project:

    libraryDependencies ++= Seq(
        "net.habashi" %% "basicauthenticator" % "1.0.0"
    )

    or

    lazy val myProject = project.dependsOn(basicauthenticator) 
  2. Extend HttpFilters and configure username/password for the BasicAuthenticator:

    class Filters @Inject()(implicit val mat: Materializer, ec: ExecutionContext) extends HttpFilters {
    
      val username = "sonic the hedgehog"
      val password = "rocks"
    
      override def filters = Seq(new BasicAuthenticationFilter(username, password))
    }
  3. Add the extended HttpFilters as Filter to the application.conf

    # Filters
    play.http.filters=net.habashi.filters.Filters

About

Simple BasicAuthenticator for Play-Framework-Apps (implemented as Filter)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages