Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Openfire
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Openfire
Commits
5e3f4161
Commit
5e3f4161
authored
Jul 24, 2015
by
Dave Cridland
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #237 from dwd/proxy-auth
Add Proxy Authorization to DefaultAuthorizationPolicy
parents
900f73ce
7d4fb62e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
DefaultAuthorizationPolicy.java
...ivesoftware/openfire/auth/DefaultAuthorizationPolicy.java
+15
-9
No files found.
src/java/org/jivesoftware/openfire/auth/DefaultAuthorizationPolicy.java
View file @
5e3f4161
...
@@ -23,6 +23,7 @@ package org.jivesoftware.openfire.auth;
...
@@ -23,6 +23,7 @@ package org.jivesoftware.openfire.auth;
import
java.util.StringTokenizer
;
import
java.util.StringTokenizer
;
import
java.util.Vector
;
import
java.util.Vector
;
import
org.jivesoftware.openfire.admin.AdminManager
;
import
org.jivesoftware.util.JiveGlobals
;
import
org.jivesoftware.util.JiveGlobals
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -62,9 +63,11 @@ public class DefaultAuthorizationPolicy implements AuthorizationPolicy {
...
@@ -62,9 +63,11 @@ public class DefaultAuthorizationPolicy implements AuthorizationPolicy {
private
static
final
Logger
Log
=
LoggerFactory
.
getLogger
(
DefaultAuthorizationPolicy
.
class
);
private
static
final
Logger
Log
=
LoggerFactory
.
getLogger
(
DefaultAuthorizationPolicy
.
class
);
private
Vector
<
String
>
approvedRealms
;
private
Vector
<
String
>
approvedRealms
;
private
boolean
proxyAuth
;
public
DefaultAuthorizationPolicy
()
{
public
DefaultAuthorizationPolicy
()
{
approvedRealms
=
new
Vector
<
String
>();
approvedRealms
=
new
Vector
<
String
>();
proxyAuth
=
false
;
String
realmList
=
JiveGlobals
.
getProperty
(
"sasl.approvedRealms"
);
String
realmList
=
JiveGlobals
.
getProperty
(
"sasl.approvedRealms"
);
if
(
realmList
!=
null
)
{
if
(
realmList
!=
null
)
{
...
@@ -73,6 +76,7 @@ public class DefaultAuthorizationPolicy implements AuthorizationPolicy {
...
@@ -73,6 +76,7 @@ public class DefaultAuthorizationPolicy implements AuthorizationPolicy {
approvedRealms
.
add
(
st
.
nextToken
());
approvedRealms
.
add
(
st
.
nextToken
());
}
}
}
}
proxyAuth
=
JiveGlobals
.
getBooleanProperty
(
"sasl.proxyAuth"
,
false
);
}
}
/**
/**
...
@@ -100,18 +104,20 @@ public class DefaultAuthorizationPolicy implements AuthorizationPolicy {
...
@@ -100,18 +104,20 @@ public class DefaultAuthorizationPolicy implements AuthorizationPolicy {
authenRealm
=
authenID
.
substring
((
authenID
.
lastIndexOf
(
"@"
)+
1
));
authenRealm
=
authenID
.
substring
((
authenID
.
lastIndexOf
(
"@"
)+
1
));
}
}
if
(!
userUser
.
equals
(
authenUser
))
{
if
(!
proxyAuth
||
!
AdminManager
.
getInstance
().
isUserAdmin
(
authenUser
,
true
))
{
//for this policy the user portion of both must match, so lets short circut here if we can
if
(!
userUser
.
equals
(
authenUser
))
{
if
(
JiveGlobals
.
getBooleanProperty
(
"xmpp.auth.ignorecase"
,
true
))
{
//for this policy the user portion of both must match, so lets short circut here if we can
if
(!
userUser
.
toLowerCase
().
equals
(
authenUser
.
toLowerCase
())){
if
(
JiveGlobals
.
getBooleanProperty
(
"xmpp.auth.ignorecase"
,
true
))
{
if
(
Log
.
isDebugEnabled
())
{
if
(!
userUser
.
toLowerCase
().
equals
(
authenUser
.
toLowerCase
())){
Log
.
debug
(
"DefaultAuthorizationPolicy: usernames don't match ("
+
userUser
+
" "
+
authenUser
+
")"
);
if
(
Log
.
isDebugEnabled
())
{
Log
.
debug
(
"DefaultAuthorizationPolicy: usernames don't match ("
+
userUser
+
" "
+
authenUser
+
")"
);
}
return
false
;
}
}
}
else
{
Log
.
debug
(
"DefaultAuthorizationPolicy: usernames don't match ("
+
userUser
+
" "
+
authenUser
+
")"
);
return
false
;
return
false
;
}
}
}
else
{
Log
.
debug
(
"DefaultAuthorizationPolicy: usernames don't match ("
+
userUser
+
" "
+
authenUser
+
")"
);
return
false
;
}
}
}
}
Log
.
debug
(
"DefaultAuthorizationPolicy: Checking authenID realm"
);
Log
.
debug
(
"DefaultAuthorizationPolicy: Checking authenID realm"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment