Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Riina Antikainen
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit aa0bccf5
authored
Feb 02, 2018
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'restFix2018' into 'master'
Fixed rest api See merge request !388
2 parents
a170840b
5946366b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
code/moya-beans/ejbModule/fi/codecrew/moya/beans/ApiApplicationBean.java
code/moya-beans/ejbModule/fi/codecrew/moya/beans/auth/RestMacAuthPBean.java
code/moya-beans/ejbModule/fi/codecrew/moya/beans/ApiApplicationBean.java
View file @
aa0bccf
...
...
@@ -39,6 +39,8 @@ import fi.codecrew.moya.model.EventUser;
import
fi.codecrew.moya.model.LanEvent
;
import
fi.codecrew.moya.utilities.PasswordFunctions
;
import
fi.codecrew.moya.utilities.moyamessage.MoyaEventType
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
/**
* Session Bean implementation class RestAuthBean
...
...
@@ -68,6 +70,7 @@ public class ApiApplicationBean implements ApiApplicationBeanLocal {
@EJB
UserBean
userBean
;
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ApiApplicationBean
.
class
);
/**
* Default constructor.
*/
...
...
@@ -131,6 +134,7 @@ public class ApiApplicationBean implements ApiApplicationBeanLocal {
}
ApiApplicationInstance
instance
=
instanceFacade
.
findInstance
(
appkey
,
userkey
,
event
);
if
(
instance
==
null
)
{
logger
.
error
(
"Tried to get Api Application Instance: appkey={}, userkey={}, domain={}, event={}"
,
appkey
,
userkey
,
domain
,
event
.
getName
());
throw
new
EJBException
(
"ApiApplicationInstance not found"
);
}
return
instance
.
getEventuser
().
getUser
().
getLogin
();
...
...
code/moya-beans/ejbModule/fi/codecrew/moya/beans/auth/RestMacAuthPBean.java
View file @
aa0bccf
...
...
@@ -32,13 +32,12 @@ public class RestMacAuthPBean extends ApiAuth implements AuthenticationFormat {
LanEvent
event
=
eventbean
.
getEventForHostname
(
domain
);
AuthenticationResult
ret
=
null
;
if
((
username
==
null
||
username
.
isEmpty
())
&&
password
.
startsWith
(
JaasBeanLocal
.
REST_PREFIX
))
{
ret
=
new
AuthenticationResult
();
ret
.
setUsertype
(
UserType
.
REST
.
name
());
if
(
password
.
startsWith
(
JaasBeanLocal
.
REST_PREFIX
))
{
if
(
restAuth
(
password
,
event
)
!=
null
)
{
ret
=
new
AuthenticationResult
();
ret
.
setUsertype
(
UserType
.
REST
.
name
());
ret
.
setUsername
(
jaasUsername
);
}
//ret.setUsername(restAuth(password, event) + '@'+domain);
}
return
ret
;
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment