亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

Shiro安全框架入門

Mark0101 JAVA開發工程師
難度中級
時長 2小時20分
學習人數
綜合評分9.37
112人評價 查看評價
9.4 內容實用
9.3 簡潔易懂
9.4 邏輯清晰
  • shiro
    查看全部
    0 采集 收起 來源:Shiro認證

    2018-04-24

  • 1 創建SecurityManager 環境

    2 主體提交(Subject)認證

    3 通過SecurityManager認證

    4 通過Authenticator 認證

    5 通過Realm 認證


    查看全部
    0 采集 收起 來源:Shiro認證

    2018-04-23

  • https://img1.sycdn.imooc.com//5add7fa90001cc4b07870324.jpg

    查看全部
    1 采集 收起 來源:Shiro過濾器

    2018-04-23

  • https://img1.sycdn.imooc.com//5add7f130001292806420295.jpg控制角色權限的注解,requirePermissions可以寫入多個角色權限,推薦使用

    查看全部
  • https://img1.sycdn.imooc.com//5add57ff00012b4607860354.jpg加鹽

    查看全部
    0 采集 收起 來源:Shiro加密

    2018-04-23

  • https://img1.sycdn.imooc.com//5add57e10001421008260328.jpgMD5加密

    查看全部
    0 采集 收起 來源:Shiro加密

    2018-04-23

  • https://img1.sycdn.imooc.com//5add564c00019b3508120294.jpg

    查看全部
    0 采集 收起 來源:Shiro加密

    2018-04-23

  • 中間

    查看全部
    0 采集 收起 來源:Shiro課程簡介

    2018-04-23

  • 開始?

    查看全部
    0 采集 收起 來源:Shiro課程簡介

    2018-04-23

  • 項目結構圖

    https://img1.sycdn.imooc.com//5adc36890001926002360253.jpg

    查看全部
    1 采集 收起 來源:Shiro集成Spring

    2018-04-22

  • springmvc.xml的配置
    <?
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    ? ? ? xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    ? ? ? xmlns:context="http://www.springframework.org/schema/context"
    ? ? ? xmlns:mvc="http://www.springframework.org/schema/mvc"
    ? ? ? xsi:schemaLocation="http://www.springframework.org/schema/beans
    ? ?http://www.springframework.org/schema/beans/spring-beans.xsd
    ? ?http://www.springframework.org/schema/context
    ? ?http://www.springframework.org/schema/context/spring-context.xsd
    ? ?http://www.springframework.org/schema/mvc
    ? ?http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
    ? ? ? ?<context:component-scan base-package="com.imooc.controller"/>
    ? ? ? ?<mvc:annotation-driven/>
    ? ? ? ?<!--排除靜態文件-->
    ? ? ? ?<mvc:resources mapping="/*" location="/"/>
    </beans>


    查看全部
    4 采集 收起 來源:Shiro集成Spring

    2018-04-22

  • spring.xml的配置
    <?
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    ? ? ? xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    ? ? ? xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
    ? ?<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
    ? ? ? ?<property name="securityManager" ref="securityManager"/>
    ? ? ? ?<property name="loginUrl" value="login.html"/>
    ? ? ? ?<property name="unauthorizedUrl" value="403.html"/>
    ? ? ? ?<property name="filterChainDefinitions">
    ? ? ? ? ? ?<value>
    ? ? ? ? ? ? ? ?/login.html = anon
    ? ? ? ? ? ? ? ?/subLogin = anon
    ? ? ? ? ? ? ? ?/* = authc
    ? ? ? ? ? ?</value>
    ? ? ? ?</property>
    ? ?</bean>
    ? ?<!--創建SecurityMananger對象-->
    ? ?<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
    ? ? ? ?<!--設置自定義Realm-->
    ? ? ? ?<property name="realm" ref="realm"/>
    ? ?</bean>

    ? ?<!--定義自定義的Realm-->
    ? ?<bean id="realm" class="com.imooc.shiro.realm.CustomerRealm">
    ? ? ? ?<property name="credentialsMatcher" ref="credentialsMatcher"/>
    ? ?</bean>

    ? ?<!--設置加密的算法-->
    ? ?<bean class="org.apache.shiro.authc.credential.HashedCredentialsMatcher"
    ? ? ? ? ?id="credentialsMatcher">
    ? ? ? ?<property name="hashAlgorithmName" value="md5"/>
    ? ? ? ?<property name="hashIterations" value="1"/>
    ? ?</bean>
    </beans>





    查看全部
    8 采集 收起 來源:Shiro集成Spring

    2018-04-22

  • web.xml的配置
    <?xml?version="1.0"?encoding="UTF-8"?>
    <web-app?xmlns="http://xmlns.jcp.org/xml/ns/javaee"
    ?????????xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    ?????????xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee?http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
    ?????????version="3.1">
    ????<filter>
    ????????<filter-name>shiroFilter</filter-name>
    ????????<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    ????</filter>
    ????<filter-mapping>
    ????????<filter-name>shiroFilter</filter-name>
    ????????<url-pattern>/*</url-pattern>
    ????</filter-mapping>
    
    ????<context-param>
    ????????<param-name>contextConfigLocation</param-name>
    ????????<param-value>classpath:spring/spring.xml</param-value>
    ????</context-param>
    ????<listener>
    ????????<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    ????</listener>
    
    ????<servlet>
    ????????<servlet-name>DispatcherServlet</servlet-name>
    ????????<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    ????????<init-param>
    ????????????<param-name>contextConfigLocation</param-name>
    ????????????<param-value>classpath:spring/springmvc.xml</param-value>
    ????????</init-param>
    ????????<load-on-startup>1</load-on-startup>
    ????????<async-supported>true</async-supported>
    ????</servlet>
    
    ????<servlet-mapping>
    ????????<servlet-name>DispatcherServlet</servlet-name>
    ????????<url-pattern>/</url-pattern>
    ????</servlet-mapping>
    
    ????<!--?注冊spring提供的針對POST請求的中文亂碼問題?-->
    ????<filter>
    ????????<filter-name>CharacterEncodingFilter</filter-name>
    ????????<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
    ????????<init-param>
    ????????????<param-name>encoding</param-name>
    ????????????<param-value>UTF-8</param-value>
    ????????</init-param>
    ????</filter>
    ????<filter-mapping>
    ????????<filter-name>CharacterEncodingFilter</filter-name>
    ????????<url-pattern>/*</url-pattern>
    ????</filter-mapping>
    </web-app>


    查看全部
    10 采集 收起 來源:Shiro集成Spring

    2018-04-22

  • MD5加密,加鹽。

    查看全部
    0 采集 收起 來源:Shiro加密

    2018-04-21

  • Shiro加密

    查看全部
    0 采集 收起 來源:Shiro加密

    2018-04-21

舉報

0/150
提交
取消
課程須知
基本必備:Java基礎,Spring基礎,使用過java web
老師告訴你能學到什么?
認識Shiro的整體架構 Shiro認證,授權過程及Session管理,緩存管理 Shiro在項目中的使用

微信掃碼,參與3人拼團

微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號

友情提示:

您好,此課程屬于遷移課程,您已購買該課程,無需重復購買,感謝您對慕課網的支持!