今天就跟大家聊聊有關(guān)springboot2集成oauth2的示例分析,可能很多人都不太了解,為了讓大家更加了解,小編給大家總結(jié)了以下內(nèi)容,希望大家根據(jù)這篇文章可以有所收獲。
站在用戶的角度思考問題,與客戶深入溝通,找到阜寧網(wǎng)站設(shè)計(jì)與阜寧網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗(yàn),讓設(shè)計(jì)與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個(gè)性化、用戶體驗(yàn)好的作品,建站類型包括:網(wǎng)站設(shè)計(jì)制作、網(wǎng)站設(shè)計(jì)、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣、域名與空間、網(wǎng)站空間、企業(yè)郵箱。業(yè)務(wù)覆蓋阜寧地區(qū)。
@EnableOAuth3Client注解,并自定義了相關(guān)配置
@Bean public FilterRegistrationBean oauth3ClientFilterRegistration(OAuth3ClientContextFilter filter) { FilterRegistrationBean registration = new FilterRegistrationBean(); registration.setFilter(filter); registration.setOrder(-100); return registration; } @Bean @ConfigurationProperties("security.oauth3") public ClientResources trina() { return new ClientResources(); }
啟動(dòng)后會(huì)報(bào)下面錯(cuò)誤:
Description: The bean 'scopedTarget.oauth3ClientContext', defined in class path resource [org/springframework/boot/autoconfigure/security/oauth3/client/OAuth3RestOperationsConfiguration$SessionScopedConfiguration$ClientContextConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [org/springframework/security/oauth3/config/annotation/web/configuration/OAuth3ClientConfiguration$OAuth3ClientContextConfiguration.class] and overriding is disabled. Action:
這個(gè)有兩種方案: 1、去掉autoconfig依賴spring-security-oauth3-autoconfigure 2、使用@EnableAutoConfiguration來排除掉oauth3相關(guān)自動(dòng)裝配,這個(gè)得根據(jù)具體報(bào)錯(cuò)信息來。 如下:
@EnableAutoConfiguration(exclude = { org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class })
3、增加配置spring.main.allow-bean-definition-overriding =true
看完上述內(nèi)容,你們對(duì)springboot2集成oauth2的示例分析有進(jìn)一步的了解嗎?如果還想了解更多知識(shí)或者相關(guān)內(nèi)容,請(qǐng)關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝大家的支持。
網(wǎng)站標(biāo)題:springboot2集成oauth2的示例分析
文章位置:http://aaarwkj.com/article40/peesho.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供用戶體驗(yàn)、建站公司、關(guān)鍵詞優(yōu)化、面包屑導(dǎo)航、App開發(fā)、網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)