文档

ALIYUN::RAM::Application

更新时间:

ALIYUN::RAM::Application类型用于创建一个应用。

语法

{
  "Type": "ALIYUN::RAM::Application",
  "Properties": {
    "PredefinedScopes": List,
    "SecretRequired": Boolean,
    "DisplayName": String,
    "IsMultiTenant": Boolean,
    "AccessTokenValidity": Integer,
    "RedirectUris": List,
    "RefreshTokenValidity": Integer,
    "AppType": String,
    "AppName": String,
    "RequiredScopes": List
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

PredefinedScopes

List

应用权限范围。

关于应用权限范围的取值和描述,请参见OAuth应用概览。您也可以调用ListPredefinedScopes - 查询系统预设的Scope列表获取不同应用类型支持的应用权限范围。

输入多个应用权限范围时,以英文分号(;)分隔。

SecretRequired

Boolean

是否需要应用密钥。

取值:

  • true:需要应用密钥。

  • false:不需要应用密钥。

说明
  • 对于WebApp和ServerApp类型的应用,该值会被强制设置为true,不支持修改。

  • 对于NativeApp类型的应用,可以设置为true或false,如不设置,默认为false。由于此类应用往往运行在非可信环境,无法有效保护应用密钥,因此建议您如无明确需要,不要设置为true。更多信息,请参见Native应用登录阿里云

DisplayName

String

应用的显示名称。

最大长度为24个字符。

IsMultiTenant

Boolean

是否允许被其他账号安装。

取值:

  • true:对于NativeApp和ServerApp类型的应用,如果该值为空,则默认为true。

  • false:对于WebApp类型的应用,如果该值为空,则默认为false。

AccessTokenValidity

Integer

访问令牌有效期。

取值范围:900~10800。单位:秒。

默认值:3600。

RedirectUris

List

回调地址。

RefreshTokenValidity

Integer

刷新令牌有效期。

取值范围:7200~31536000。单位:秒。

默认值:

  • 对于NativeApp和ServerApp类型的应用,如果该值为空,则默认为2592000秒(即30天)。

  • 对于WebApp类型的应用,如果该值为空,则默认为7776000秒(即90天)。

AppType

String

应用类型。

取值:

  • WebApp:指基于浏览器交互的网络应用。

  • NativeApp:指操作系统中运行的本地应用,主要为运行在桌面操作系统或移动操作系统中的应用。

  • ServerApp:指直接访问阿里云服务,而无需依赖用户登录的应用,目前仅支持基于SCIM协议的用户同步应用。

AppName

String

应用名称。

最大长度为64 个字符,允许输入英文字母、数字、英文句点(.)、下划线(_)或中划线(-)。

RequiredScopes

List

必选的应用权限范围。

您可以将RequiredScopes中设置的一个或多个范围设为必选,设为必选后,当用户进行应用授权时,必选范围默认选中且不可取消。

说明

如果您设置的RequiredScopes项不在PredefinedScopes的范围内,则该项必选范围不生效。

返回值

Fn::GetAtt

  • AppId:应用ID。

  • AppName:应用名称。

示例

  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      DisplayName:
        Type: String
        MaxLength: 24
        Default: myapp
      AppType:
        Type: String
        Description: |-
          The type of the application. Valid values:
          - **WebApp**: a web application that interacts with a browser.
          - **NativeApp**: a native application that runs on an operating system, such as a desktop operating system or a mobile operating system.
          - **ServerApp**: an application that accesses Alibaba Cloud services without the need of manual user logon. User provisioning is automated based on the System for Cross-Domain Identity Management (SCIM) protocol.
        Default: WebApp
      AppName:
        Type: String
        Description: The name of the application. The name can be up to 64 characters in length. The name can contain letters, digits, periods (.), underscores (_), and hyphens (-).
        AllowedPattern: ^[-_.a-zA-Z0-9]{1,64}$
        Default: myapp
    Resources:
      Application:
        Type: ALIYUN::RAM::Application
        Properties:
          DisplayName:
            Ref: DisplayName
          AppType:
            Ref: AppType
          AppName:
            Ref: AppName
    Outputs:
      AppId:
        Description: The ID of the application.
        Value:
          Fn::GetAtt:
            - Application
            - AppId
      AppName:
        Description: The name of the application.
        Value:
          Fn::GetAtt:
            - Application
            - AppName
    
  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "DisplayName": {
          "Type": "String",
          "MaxLength": 24,
          "Default": "myapp"
        },
        "AppType": {
          "Type": "String",
          "Description": "The type of the application. Valid values:\n- **WebApp**: a web application that interacts with a browser.\n- **NativeApp**: a native application that runs on an operating system, such as a desktop operating system or a mobile operating system.\n- **ServerApp**: an application that accesses Alibaba Cloud services without the need of manual user logon. User provisioning is automated based on the System for Cross-Domain Identity Management (SCIM) protocol.",
          "Default": "WebApp"
        },
        "AppName": {
          "Type": "String",
          "Description": "The name of the application. The name can be up to 64 characters in length. The name can contain letters, digits, periods (.), underscores (_), and hyphens (-).",
          "AllowedPattern": "^[-_.a-zA-Z0-9]{1,64}$",
          "Default": "myapp"
        }
      },
      "Resources": {
        "Application": {
          "Type": "ALIYUN::RAM::Application",
          "Properties": {
            "DisplayName": {
              "Ref": "DisplayName"
            },
            "AppType": {
              "Ref": "AppType"
            },
            "AppName": {
              "Ref": "AppName"
            }
          }
        }
      },
      "Outputs": {
        "AppId": {
          "Description": "The ID of the application.",
          "Value": {
            "Fn::GetAtt": [
              "Application",
              "AppId"
            ]
          }
        },
        "AppName": {
          "Description": "The name of the application.",
          "Value": {
            "Fn::GetAtt": [
              "Application",
              "AppName"
            ]
          }
        }
      }
    }
                            
  • 本页导读 (1)
文档反馈