mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
Use truly generic HTTP-based credentials object, rename project to guacamole-auth (truly, this is a basic framework for extending Guacamole, a single webapp, NOT part of guacamole-common, which is the basis of the Guacamole webapp and potentially others).
This commit is contained in:
@@ -3,10 +3,10 @@
|
|||||||
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>net.sourceforge.guacamole</groupId>
|
<groupId>net.sourceforge.guacamole</groupId>
|
||||||
<artifactId>guacamole-common-auth</artifactId>
|
<artifactId>guacamole-auth</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<version>0.6.0</version>
|
<version>0.6.0</version>
|
||||||
<name>guacamole-common-auth</name>
|
<name>guacamole-auth</name>
|
||||||
<url>http://guacamole.sourceforge.net/</url>
|
<url>http://guacamole.sourceforge.net/</url>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
@@ -31,6 +31,14 @@
|
|||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
|
<!-- Java servlet API -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.servlet</groupId>
|
||||||
|
<artifactId>servlet-api</artifactId>
|
||||||
|
<version>2.5</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Guacamole Java API -->
|
<!-- Guacamole Java API -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.sourceforge.guacamole</groupId>
|
<groupId>net.sourceforge.guacamole</groupId>
|
||||||
|
@@ -43,13 +43,11 @@ import net.sourceforge.guacamole.protocol.GuacamoleConfiguration;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides means of retrieving a set of named GuacamoleConfigurations for a
|
* Provides means of retrieving a set of named GuacamoleConfigurations for a
|
||||||
* given arbitrary credentials object.
|
* given Credentials object.
|
||||||
*
|
*
|
||||||
* @author Michael Jumper
|
* @author Michael Jumper
|
||||||
* @param <CredentialType> The type to use as credentials for determining which
|
|
||||||
* configurations are authorized.
|
|
||||||
*/
|
*/
|
||||||
public interface AuthenticationProvider<CredentialType> {
|
public interface AuthenticationProvider {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Given an arbitrary credentials object, returns a Map containing all
|
* Given an arbitrary credentials object, returns a Map containing all
|
||||||
@@ -64,7 +62,7 @@ public interface AuthenticationProvider<CredentialType> {
|
|||||||
* configurations.
|
* configurations.
|
||||||
*/
|
*/
|
||||||
public Map<String, GuacamoleConfiguration>
|
public Map<String, GuacamoleConfiguration>
|
||||||
getAuthorizedConfigurations(CredentialType credentials)
|
getAuthorizedConfigurations(Credentials credentials)
|
||||||
throws GuacamoleException;
|
throws GuacamoleException;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,8 @@
|
|||||||
package net.sourceforge.guacamole.net.auth;
|
package net.sourceforge.guacamole.net.auth;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpSession;
|
||||||
|
|
||||||
/* ***** BEGIN LICENSE BLOCK *****
|
/* ***** BEGIN LICENSE BLOCK *****
|
||||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||||
*
|
*
|
||||||
@@ -43,7 +46,7 @@ package net.sourceforge.guacamole.net.auth;
|
|||||||
*
|
*
|
||||||
* @author Michael Jumper
|
* @author Michael Jumper
|
||||||
*/
|
*/
|
||||||
public class UsernamePassword {
|
public class Credentials {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An arbitrary username.
|
* An arbitrary username.
|
||||||
@@ -55,6 +58,16 @@ public class UsernamePassword {
|
|||||||
*/
|
*/
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The HttpServletRequest carrying additional credentials, if any.
|
||||||
|
*/
|
||||||
|
private HttpServletRequest request;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The HttpSession carrying additional credentials, if any.
|
||||||
|
*/
|
||||||
|
private HttpSession session;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the password associated with this username/password pair.
|
* Returns the password associated with this username/password pair.
|
||||||
* @return The password associated with this username/password pair, or
|
* @return The password associated with this username/password pair, or
|
||||||
@@ -91,4 +104,20 @@ public class UsernamePassword {
|
|||||||
this.username = username;
|
this.username = username;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public HttpServletRequest getRequest() {
|
||||||
|
return request;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRequest(HttpServletRequest request) {
|
||||||
|
this.request = request;
|
||||||
|
}
|
||||||
|
|
||||||
|
public HttpSession getSession() {
|
||||||
|
return session;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSession(HttpSession session) {
|
||||||
|
this.session = session;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Reference in New Issue
Block a user