java ee - Apache Shiro Token based security for Rest service -


i'm creating app using shiro security framework. app have 2 parts; web , rest.

the web using shiro's default formauthenticationfilter. i'm happy session based approach.

the stand alone app using rest, want limit using formauthenticationfilter , creating session, i'm able via shiro.ini file

i need implement token based security on rest service or of sort. browsing on web saw blogs suggesting create own realm , filter handle scenario. no details on how this.

is possible implement token based security on apache shiro? if there blog or tutorial shows how achieve this?

regards

you use basic auth webservice endpoints , form based authentication web.

do web users have access webservice?

edit:

checkout sample app. https://github.com/dominicfarr/skybird-shiro

it has 3 url paths configured in shiro.

web - uses form authentication.

api - uses basic authentication.

jersey - anonymous access.

cutting shiro.ini config.

[main] authc.loginurl = /web/login.html  sessionmanager = org.apache.shiro.web.session.mgt.defaultwebsessionmanager sessiondao = org.apache.shiro.session.mgt.eis.enterprisecachesessiondao  securitymanager.sessionmanager = $sessionmanager securitymanager.sessionmanager.sessiondao = $sessiondao   [users] dom = password, user  [roles] user = standard  [urls] /web/login.html = authc /web/** = authc /api/** = authcbasic /jersey/message = anon 

Comments

Popular posts from this blog

php - Magento - Deleted Base url key -

javascript - Tooltipster plugin not firing jquery function when button or any click even occur -

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -