Shiro 1 User Manual

Browse online or download User Manual for MP3/MP4 players Shiro 1. Easy Application Security with Apache Shiro

  • Download
  • Add to my manuals
  • Print

Summary of Contents

Page 1 - 5/#%6"7(/3,,8%

!"#$%&''()*"+,-%./*01)2$%%3)24%&'"*4/%.4)1,%5/#%6"7(/3,,8%!"#$%&'(%)*+',*+-&$.'

Page 2

.2/'%HI%C,((/*+-;%B1 )-* )'"(#%J%C 1/8/-+"(#% UsernamePasswordToken token = new UsernamePasswordToken(username, password); //”Rem

Page 3 - DOWNLOADS

.2/'%KI%.0@?)##),-%Subject currentUser = SecurityUtils.getSubject(); currentUser.login(token);

Page 4 - &;/-8"%

.2/'%LI%M1"-2%&**/##%,1%6"-8(/%G")(01/ %%try { currentUser.login(token); } catch (UnknownAccountException uae ){ ... } ca

Page 5 - <0)*=%>/1?)-,(,;$%

6,3%8,/#%)2%3,1=:%(>D-&$.' 5=+<)8W.+B&8X'

Page 6 - &024/-+*"+,-%

6,3%8,/#%)2%3,1=:%(>D-&$.'(&$>*).:;#8#<&*'5=+<)8W.+B&8X'

Page 7 - &024/-+*"+,-%E/F-/8%

6,3%8,/#%)2%3,1=:%(>D-&$.'(&$>*).:;#8#<&*'!>.%&89$#.+*'5=+<)8W.+B&8X'

Page 8

6,3%8,/#%)2%3,1=:%(>D-&$.'(&$>*).:;#8#<&*'!>.%&89$#.+*'Y&#=3'['5=+<)8W.+B&8X'\&ap

Page 9

6,3%8,/#%)2%3,1=:%(>D-&$.'(&$>*).:;#8#<&*'!>.%&89$#.+*'Y&#=3'['5=+<)8W.+B&8X'!>

Page 10 - //”Remember Me” built-in:

&024,1)7"+,-%P&D'(>""+*.'!>Q)=)#*:'H&#.>*&4'(&44)+8';#8#<&3&8.'!&

Page 11 - SecurityUtils.getSubject();

&024,1)7"+,-%E/F-/8%,*+$&44'+?'7&.&*3)8)8<'_A%+'$#8'7+'A%#.`'!G!'!$$&44'/+8.*

Page 12

•  67&89.:';#8#<&3&8.'#87'!$$&44'/+8.*+='!,6'•  (&$>*).:'?+*'your'#""

Page 13 - 6,3%8,/#%)2%3,1=:%

B/1?)##),-#%E/F-/8%•  ;+4.'#.+3)$'4&$>*).:'&=&3&8.''•  E&4$*)D&4'*&4+>*$&'typ

Page 14

D,(/#%E/F-/8%•  63"=)$).'+*'NQ"=)$).'$+84.*>$.'•  63"=)$).K'^#3&'+8=:'•  NQ"=)$).K'

Page 15

O#/1#%E/F-/8%•  0%&'_A%+`'+?'.%&'#""=)$#9+8'•  'P%#.'&#$%'>4&*'$#8'7+&a

Page 16

&024,1)7"+,-%G/"201/#%•  (>D-&$.T$&8.*)$'W$>**&8.'>4&*X'•  /%&$B4'D#4&7'+8&apo

Page 17

6,3%2,%&024,1)7/%3)24%.4)1,%;>=9"=&'3&#84'+?'$%&$B)8<'#$$&44'$+8.*+=K'•  ,*+<*#33#9$#=

Page 18 - &024,1)7"+,-%

B1,;1"??"+*%&024,1)7"+,-% //get the current Subject Subject currentUser = SecurityUtils.getSubject(); if (currentUser.hasRole(

Page 19 - &024,1)7"+,-%E/F-/8%

B1,;1"??"+*%&024,1)7"+,-%Subject currentUser = SecurityUtils.getSubject(); Permission deleteUser = new UserPermission(“jsmith

Page 20 - B/1?)##),-#%E/F-/8%

B1,;1"??"+*%&024,1)7"+,-%String perm = “user:delete:jsmith”; if(currentUser.isPermitted(perm)){ //show the ‘delete user’ butto

Page 21 - D,(/#%E/F-/8%

&--,2"+,-%&024,1)7"+,-%@RequiresRoles( “teller” ) public void openAccount(Account a) { //do something in here that //only

Page 22 - O#/1#%E/F-/8%

&--,2"+,-%&024,1)7"+,-%@RequiresPermissions(“account:create”) public void openAccount(Account a) { //create the account } ,&am

Page 23

Explosive Growth in Apache Shiro Aug 2012 Dec 2010 300K DOWNLOADS •  !""=)$#9+8'4&$>*).:'?*#3&A+*B'•  !(H'0I,

Page 24 - •  ,*+<*#33#9$#==:'

!-2/1'1)#/%./##),-%Q"-";/?/-2%P&D'(>""+*.'!>Q)=)#*:'H&#.>*&4'!>.%+*)R#9+8'!&

Page 25 - Y+=&'/%&$B'

./##),-%Q"-";/?/-2%E/F-/8%;#8#<)8<'.%&'=)?&$:$=&'+?'(>D-&$.T4"&$)O$'.&3"

Page 26

./##),-%Q"-";/?/-2%G/"201/#%•  Z&.&*+<&8&+>4'$=)&8.'#$$&44'•  ,1a1La](N'D#4&7&apo

Page 27

&*R0)1)-;%"-8%C1/"+-;%./##),-#%Subject currentUser = SecurityUtils.getSubject() //guarantee a session Session session = subject.get

Page 28

./##),-%&BS%getStartTimestamp() getLastAccessTime() getAttribute(key) setAttribute(key, value) get/setTimeout(long) touch() ...

Page 29 - //create the account

C1$'2,;1"'4$%P&D'(>""+*.'!>Q)=)#*:'H&#.>*&4'!>.%+*)R#9+8'!>.%&89$#9+8

Page 30

C1$'2,;1"'4$%E/F-/8%,*+.&$98<')8?+*3#9+8'?*+3'>87&4)*&7'#$$&44'D:'%)7)8<').

Page 31

C)'4/1#%E/F-/8%N8$*:"9+8'#87'7&$*:"9+8'7#.#'D#4&7'+8'4%#*&7'+*'">D=)$L"

Page 32

6"#4/#%E/F-/8%!'+8&TA#:2')**&F&*4)D=&'$+8F&*4)+8'+?'#8')8">.'4+>*$&'W#

Page 33

C1$'2,;1"'4$%G/"201/#%.)?'()*)2$%•  68.&*?#$&T7*)F&82',1a1'D#4&7'•  ()3"=)O&7'A*

Page 34 - ./##),-%&BS%

&;/-8"%P&D'(>""+*.'!>Q)=)#*:'H&#.>*&4'!>.%&89$#9+8'(&44)+8';#8#<&a

Page 35 - C1$'2,;1"'4$%

C)'4/1%G/"201/#%•  11'Z)&*#*$%:''a$#/)"%&*(&*F)$&2'!D4.*#$.(:33&.*)$/)"%&*(&*F)$&a

Page 36

!P"?'(/I%B(")-2/P2%W)3#<&'$+>*.&4:'P)B),&7)#X'

Page 37 - C)'4/1#%E/F-/8%

!P"?'(/I%!CV%Q,8/%WXEY%E/N"0(2Z[%W)3#<&'$+>*.&4:'P)B),&7)#X'

Page 38 - 6"#4/#%E/F-/8%

!P"?'(/I%.4)1,%E/ N "0(2#%W)3#<&'$+>*.&4:'P)B),&7)#X'

Page 39 - .)?'()*)2$%

.4)1,\#%C)'4/1./1])*/%S-2/1N"*/%public interface CipherService { ByteSource encrypt(byte[] raw, byte[] key); void encrypt(In

Page 40 - C)'4/1%G/"201/#%

6"#4%G/"201/#%•  E&?#>=.')8.&*?#$&')3"=&3&8.#9+84';Eb2'(Z![2'(Z!T]bk2'&.5&apos

Page 41

.4)1,\#%6"#4%S-2/1N"*/%public interface Hash { byte[] getBytes(); String toHex(); String toBase64(); }

Page 42

S-20)+]/%^^%6"#4%&BS%//some examples: new Md5Hash(“foo”).toHex(); //File MD5 Hash value for checksum: new Md5Hash( aFile ).toHex(); //store

Page 43

9/@%.0'',12%9/@%.0'',12%!>Q)=)#*:'H&#.>*&4'/*:".+<*#"%:'(&44)+8';#8#<&3&

Page 44

9/@%.0'',12%G/"201/#%•  ()3"=&'(%)*+H)=.&*'A&D5Q3='7&O8)9+8'•  ,*+.&$.4'#=='@YI4

Page 45 - 6"#4%G/"201/#%

<0)*=%>/1?)-,(,;$%•  .0@A/*2%S'(&$>*).:T4"&$)O$'>4&*'UF)&AV'•  B1)-*)'"(#'S'(

Page 46

3/@_P?(%<filter> <filter-name>ShiroFilter</filter-name> <filter-class> org.apache.shiro.web.servlet.IniShiroFilter <

Page 47

#4)1,_)-)%[main] ldapRealm = org.apache.shiro.realm.ldap.JndiLdapRealm ldapRealm.userDnTemplate = uid={0},ou=users,dc=mycompany,dc=com ldapRealm.conte

Page 48 - 9/@%.0'',12%

X.B%>";5)@%&024,1)7"+,-%<%@ taglib prefix=“shiro” uri=“http://shiro.apache.org/tags” %> <html> <body>

Page 49

X.B%>";5)@#%<%@ taglib prefix=“shiro” uri=http://shiro.apache.org/tags %> <!-- Other tags: --> <shiro:guest/> <shiro:use

Page 50 - 3/@_P?(%

&0P)()"1$%G/"201/#%P&D'(>""+*.'&0P)()"1$%G/"201/#%/*:".+<*#"%:'(&44)+8&ap

Page 51 - #4)1,_)-)%

&0P)()"1$%G/"201/#%•  0%*&#7)8<'c'/+8$>**&8$:'/#==#D=&LY>88#D=&'c'NQ&$>.+*LNQ&a

Page 52

5,;;)-;%^02%18&'3&.%+7K' !""T4"&$)O$'=+<T+>.'=+<)$K'g&?+*&L!m&*'.%&am

Page 53 - X.B%>";5)@#%

C,?)-;%)-%H_L`%K_a%•  0:"&4#?&'NF&8.g>4'•  110g'Z#R&=$#4.'(&44)+8'$=>4.&*)8<'•  I+

Page 54

&''()*"+,-%b%.2,1?'"24%D/"(?%.2,1?'"24I%O#/1%Q"-";/?/-2%&BS%./1])*/%^02U,NU24/U@,P%G/"2

Page 55

B0@()*%C(,08%.2,1?'"24I%C(,08%E/'(,$?/-2%&''()*"+,-%&''()*"+,-%&''()*"+,-%&

Page 56 - 5,;;)-;%^02%

&024/-+*"+,-%P&D'(>""+*.'!>Q)=)#*:'H&#.>*&4'(&44)+8';#8#<&3&8.'!&

Page 57 - C,?)-;%)-%H_L`%K_a%

>4"-=%d,0Z%•  =&4o4.+*3"#.%5$+3'•  0A)J&*K'o=%#R=&A++7'•  %J"KLLAAA54.+*3"#.%5$+3'

Page 58

&024/-+*"+,-%E/F-/8%Identity verification: Proving a user is who he says he is

Page 59 - .2,1?'"24%

.4)1,%&024/-+*"+,-%G/"201/#%•  (>D-&$.TD#4&7'W$>**&8.'>4&*X'•  ()8<=&'3&.%+7&apo

Page 60 - >4"-=%d,0Z%

6,3%2,%&024/-+*"2/%3)24%.4)1,%Steps 1.  Collect principals & credentials 2.  Submit to Authentication System 3.  Allow, retry, or block a

Comments to this Manuals

No comments