首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Mule OAuth2 -无法解决“模块-安全性-OAuth2-提供者”

Mule OAuth2 -无法解决“模块-安全性-OAuth2-提供者”
EN

Stack Overflow用户
提问于 2015-07-21 07:26:36
回答 1查看 1K关注 0票数 0

我尝试从穆莱索夫特运行“简单”示例,但总是以以下构建失败告终

代码语言:javascript
运行
复制
Failed to execute goal on project test: Could not resolve dependencies for project XXX: Failed to collect dependencies at com.mulesoft.security:mule-module-security-oauth2-provider:jar:1.3.2: Failed to read artifact descriptor for com.mulesoft.security:mule-module-security-oauth2-provider:jar:1.3.2: Failure to find com.mulesoft.security:mule-module-security:pom:1.3.2 in http://repo1.maven.org/maven2/ was cached in the local repository, resolution will not be reattempted until the update interval of Central has elapsed or updates are forced -> [Help 1]

我的流量是

代码语言:javascript
运行
复制
<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:http="http://www.mulesoft.org/schema/mule/http"
	xmlns:oauth2-provider="http://www.mulesoft.org/schema/mule/oauth2-provider"
	xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
	xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.6.1"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mule-ss="http://www.mulesoft.org/schema/mule/spring-security"
	xmlns:ss="http://www.springframework.org/schema/security"
	xsi:schemaLocation="http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/spring-security http://www.mulesoft.org/schema/mule/spring-security/current/mule-spring-security.xsd
http://www.mulesoft.org/schema/mule/oauth2-provider http://www.mulesoft.org/schema/mule/oauth2-provider/current/mule-oauth2-provider.xsd">

	<spring:beans>
		<ss:authentication-manager id="resourceOwnerAuthenticationManager">
			<ss:authentication-provider>
				<ss:user-service id="resourceOwnerUserService">
					<ss:user name="john" password="doe" authorities="RESOURCE_OWNER" />
				</ss:user-service>
			</ss:authentication-provider>
		</ss:authentication-manager>
	</spring:beans>

	<mule-ss:security-manager>
		<mule-ss:delegate-security-provider
			name="resourceOwnerSecurityProvider" delegate-ref="resourceOwnerAuthenticationManager" />
	</mule-ss:security-manager>

	<oauth2-provider:config name="oauth2ProviderCode"
		providerName="SampleAPI" port="8081" authorizationEndpointPath="sampleapi/api/authorize"
		accessTokenEndpointPath="sampleapi/api/token"
		resourceOwnerSecurityProvider-ref="resourceOwnerSecurityProvider"
		scopes="READ_RESOURCE POST_RESOURCE" doc:name="OAuth provider module">
		<oauth2-provider:clients>
			<oauth2-provider:client clientId="myclientid"
				secret="myclientsecret" type="CONFIDENTIAL" clientName="Mule Bookstore"
				description="Mule-powered On-line Bookstore">
				<oauth2-provider:redirect-uris>
					<oauth2-provider:redirect-uri>http://localhost*</oauth2-provider:redirect-uri>
				</oauth2-provider:redirect-uris>
				<oauth2-provider:authorized-grant-types>
					<oauth2-provider:authorized-grant-type>AUTHORIZATION_CODE</oauth2-provider:authorized-grant-type>
				</oauth2-provider:authorized-grant-types>
				<oauth2-provider:scopes>
					<oauth2-provider:scope>READ_RESOURCE</oauth2-provider:scope>
					<oauth2-provider:scope>POST_RESOURCE</oauth2-provider:scope>
				</oauth2-provider:scopes>
			</oauth2-provider:client>
		</oauth2-provider:clients>
	</oauth2-provider:config>
	<http:listener-config name="HTTP_Listener_Configuration"
		host="localhost" port="8081" doc:name="HTTP Listener Configuration" />
	<flow name="protected-authcode">
		<http:listener config-ref="HTTP_Listener_Configuration"
			path="/resources" doc:name="HTTP" />
		<oauth2-provider:validate config-ref="oauth2ProviderCode"
			doc:name="Validate Token" scopes="READ_RESOURCE" />
		<set-payload
			value="#[ ['name' : 'payroll', 'uri' : 'http://localhost:8081/resources/payroll'] ]"
			doc:name="Set Payload" />
		<json:object-to-json-transformer
			doc:name="Object to JSON" />
	</flow>


	<!-- THIS FLOW IS JUST AN AID TO HELP MANUAL TESTING OF THE OAUTH2 DANCE -->
	<flow name="redirectFlow">
		<http:listener config-ref="HTTP_Listener_Configuration"
			path="/redirect" doc:name="HTTP" />
		<set-property value="302" propertyName="http.status"
			doc:name="Property" />
		<set-property propertyName="Location"
			value="http://localhost:8081/sampleapi/api/token?grant_type=authorization_code&amp;&amp;client_id=myclientid&amp;client_secret=myclientsecret&amp;code=#[message.inboundProperties.code]
     &amp;redirect_uri=http://localhost:8081/redirect"
			doc:name="Property" />
	</flow>
</mule>

在我的POM文件中,我有以下回复:

代码语言:javascript
运行
复制
...		
<dependency>
			<groupId>com.mulesoft.security</groupId>
			<artifactId>mule-module-security-oauth2-provider</artifactId>
			<version>1.3.2</version>
		</dependency>
...

<repositories>
		<repository>
			<id>Central</id>
			<name>Central</name>
			<url>http://repo1.maven.org/maven2/</url>
			<layout>default</layout>
		</repository>
		<repository>
			<id>mulesoft-releases</id>
			<name>MuleSoft Releases Repository</name>
			<url>http://repository.mulesoft.org/releases/</url>
			<layout>default</layout>
		</repository>
		<repository>
			<id>mulesoft-snapshots</id>
			<name>MuleSoft Snapshots Repository</name>
			<url>http://repository.mulesoft.org/snapshots/</url>
			<layout>default</layout>
		</repository>
		<repository>
			<id>mulesoft-releases2</id>
			<name>MuleSoft Releases Repository2</name>
			<url>https://repository.mulesoft.org/nexus/content/repositories/public/</url>
			<layout>default</layout>
		</repository>
	</repositories>

这个安全模块属于任意点的企业安全,我认为应该记住,Mule有一个企业事务的安全存储库。会不会是我要联系穆勒才能进入?但另一方面,在他们的网站和给出的例子中没有这方面的信息。有人知道我能试着解决这个问题并成功地运行这个例子吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-07-22 15:46:57

是的,有一个EE回购,需要一个用户名/密码组合,将由Mulesoft提供。如果您是客户,可以通过支持门户与他们联系。

代码语言:javascript
运行
复制
        <repository>
            <id>mulesoft-ee-release</id>
            <name>Mulesoft EE</name>
            <url>https://repository.mulesoft.org/nexus-ee/content/repositories/releases-ee/</url>
        </repository>

然后在Maven settings.xml中设置用户名/密码。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31532800

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档