关于 <provider> 一个简单使用问题

参考文献

https://blog.csdn.net/luck_mw/article/details/54970105 

https://blog.csdn.net/lmj623565791/article/details/72859156  

https://developer.android.google.cn/training/secure-file-sharing/setup-sharing  国内能打开

主要配置如下

<manifest>
<application>
<provider
    android:name="android.support.v4.content.FileProvider"
    android:authorities="${applicationId}.fileprovider"
    android:exported="false"
    android:grantUriPermissions="true">
    <meta-data
        android:name="android.support.FILE_PROVIDER_PATHS"
        android:resource="@xml/file_paths"/>
</provider>

在res下xml文件(没有就自己创建一个)中新建一个file_paths.xml文件

<?xml version="1.0" encoding="utf-8"?>
<paths>
    <root-path
        name="root"
        path=""/>
    <files-path
        name="files"
        path=""/>

    <cache-path
        name="cache"
        path=""/>

    <external-path
        name="external"
        path=""/>

    <external-files-path
        name="external_file_path"
        path=""/>

    <external-cache-path
        name="external_cache_path"
        path=""/>

</paths>

配置完成

 

配置 `spring-cloud-starter-oauth2` 的方法通常如下: 1. 在 Maven 项目的 `pom.xml` 中添加以下依赖项: ```xml <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-oauth2</artifactId> <version>2.2.5.RELEASE</version> </dependency> ``` 2. 在 Spring Boot 应用程序的配置文件中添加以下配置: ```yaml spring: security: oauth2: client: registration: <client-registration-id>: client-id: <client-id> client-secret: <client-secret> scope: <scope> redirect-uri: '{baseUrl}/login/oauth2/code/{registrationId}' authorization-grant-type: authorization_code client-name: <client-name> provider: <provider-id>: authorization-uri: <authorization-uri> token-uri: <token-uri> user-info-uri: <user-info-uri> user-name-attribute: <user-name-attribute> ``` 其中,`<client-registration-id>` 是您为客户端应用程序分配的唯一标识符,`<client-id>` 和 `<client-secret>` 是您为客户端应用程序分配的 OAuth2 凭证,`<scope>` 是客户端应用程序请求的访问范围,`<provider-id>` 是 OAuth2 服务提供商的唯一标识符,`<authorization-uri>`,`<token-uri>` 和 `<user-info-uri>` 分别是 OAuth2 服务提供商的授权,令牌和用户信息端点的 URI,`<user-name-attribute>` 是 OAuth2 服务提供商的用户信息端点返回的用户名属性名称。 3. 在 Spring Boot 应用程序中使用 `@EnableOAuth2Client` 注释启用 OAuth2 客户端功能,并使用 `@Autowired` 注释将 `OAuth2AuthorizedClientService` 添加到 Spring Bean 中。 ```java @SpringBootApplication @EnableOAuth2Client public class MyApplication { @Autowired private OAuth2AuthorizedClientService authorizedClientService; // ... } ``` 以上是 `spring-cloud-starter-oauth2` 的简单配置方法。根据您的具体需求,可能需要更多的配置。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值