Spring OAuth2数据库表

水深无声 2022-05-10 04:38 132阅读 0赞
  1. CREATE SCHEMA IF NOT EXISTS `oauth2` DEFAULT CHARACTER SET utf8 ;
  2. USE `oauth2` ;
  3. -- -----------------------------------------------------
  4. -- Table `oauth2`.`clientdetails`
  5. -- -----------------------------------------------------
  6. CREATE TABLE IF NOT EXISTS `oauth2`.`clientdetails` (
  7. `appId` VARCHAR(128) NOT NULL,
  8. `resourceIds` VARCHAR(256) NULL DEFAULT NULL,
  9. `appSecret` VARCHAR(256) NULL DEFAULT NULL,
  10. `scope` VARCHAR(256) NULL DEFAULT NULL,
  11. `grantTypes` VARCHAR(256) NULL DEFAULT NULL,
  12. `redirectUrl` VARCHAR(256) NULL DEFAULT NULL,
  13. `authorities` VARCHAR(256) NULL DEFAULT NULL,
  14. `access_token_validity` INT(11) NULL DEFAULT NULL,
  15. `refresh_token_validity` INT(11) NULL DEFAULT NULL,
  16. `additionalInformation` VARCHAR(4096) NULL DEFAULT NULL,
  17. `autoApproveScopes` VARCHAR(256) NULL DEFAULT NULL,
  18. PRIMARY KEY (`appId`))
  19. ENGINE = InnoDB
  20. DEFAULT CHARACTER SET = utf8;
  21. -- -----------------------------------------------------
  22. -- Table `oatuh2`.`oauth_access_token`
  23. -- -----------------------------------------------------
  24. CREATE TABLE IF NOT EXISTS `oauth2`.`oauth_access_token` (
  25. `token_id` VARCHAR(256) NULL DEFAULT NULL,
  26. `token` BLOB NULL DEFAULT NULL,
  27. `authentication_id` VARCHAR(128) NOT NULL,
  28. `user_name` VARCHAR(256) NULL DEFAULT NULL,
  29. `client_id` VARCHAR(256) NULL DEFAULT NULL,
  30. `authentication` BLOB NULL DEFAULT NULL,
  31. `refresh_token` VARCHAR(256) NULL DEFAULT NULL,
  32. PRIMARY KEY (`authentication_id`))
  33. ENGINE = InnoDB
  34. DEFAULT CHARACTER SET = utf8;
  35. -- -----------------------------------------------------
  36. -- Table `oatuh2`.`oauth_approvals`
  37. -- -----------------------------------------------------
  38. CREATE TABLE IF NOT EXISTS `oauth2`.`oauth_approvals` (
  39. `userId` VARCHAR(256) NULL DEFAULT NULL,
  40. `clientId` VARCHAR(256) NULL DEFAULT NULL,
  41. `scope` VARCHAR(256) NULL DEFAULT NULL,
  42. `status` VARCHAR(10) NULL DEFAULT NULL,
  43. `expiresAt` DATETIME NULL DEFAULT NULL,
  44. `lastModifiedAt` DATETIME NULL DEFAULT NULL)
  45. ENGINE = InnoDB
  46. DEFAULT CHARACTER SET = utf8;
  47. -- -----------------------------------------------------
  48. -- Table `oatuh2`.`oauth_client_details`
  49. -- -----------------------------------------------------
  50. CREATE TABLE IF NOT EXISTS `oauth2`.`oauth_client_details` (
  51. `client_id` VARCHAR(128) NOT NULL,
  52. `resource_ids` VARCHAR(256) NULL DEFAULT NULL,
  53. `client_secret` VARCHAR(256) NULL DEFAULT NULL,
  54. `scope` VARCHAR(256) NULL DEFAULT NULL,
  55. `authorized_grant_types` VARCHAR(256) NULL DEFAULT NULL,
  56. `web_server_redirect_uri` VARCHAR(256) NULL DEFAULT NULL,
  57. `authorities` VARCHAR(256) NULL DEFAULT NULL,
  58. `access_token_validity` INT(11) NULL DEFAULT NULL,
  59. `refresh_token_validity` INT(11) NULL DEFAULT NULL,
  60. `additional_information` VARCHAR(4096) NULL DEFAULT NULL,
  61. `autoapprove` VARCHAR(256) NULL DEFAULT NULL,
  62. PRIMARY KEY (`client_id`))
  63. ENGINE = InnoDB
  64. DEFAULT CHARACTER SET = utf8;
  65. -- -----------------------------------------------------
  66. -- Table `oatuh2`.`oauth_client_token`
  67. -- -----------------------------------------------------
  68. CREATE TABLE IF NOT EXISTS `oauth2`.`oauth_client_token` (
  69. `token_id` VARCHAR(256) NULL DEFAULT NULL,
  70. `token` BLOB NULL DEFAULT NULL,
  71. `authentication_id` VARCHAR(128) NOT NULL,
  72. `user_name` VARCHAR(256) NULL DEFAULT NULL,
  73. `client_id` VARCHAR(256) NULL DEFAULT NULL,
  74. PRIMARY KEY (`authentication_id`))
  75. ENGINE = InnoDB
  76. DEFAULT CHARACTER SET = utf8;
  77. -- -----------------------------------------------------
  78. -- Table `oatuh2`.`oauth_code`
  79. -- -----------------------------------------------------
  80. CREATE TABLE IF NOT EXISTS `oauth2`.`oauth_code` (
  81. `code` VARCHAR(256) NULL DEFAULT NULL,
  82. `authentication` BLOB NULL DEFAULT NULL)
  83. ENGINE = InnoDB
  84. DEFAULT CHARACTER SET = utf8;
  85. -- -----------------------------------------------------
  86. -- Table `oatuh2`.`oauth_refresh_token`
  87. -- -----------------------------------------------------
  88. CREATE TABLE IF NOT EXISTS `oauth2`.`oauth_refresh_token` (
  89. `token_id` VARCHAR(256) NULL DEFAULT NULL,
  90. `token` BLOB NULL DEFAULT NULL,
  91. `authentication` BLOB NULL DEFAULT NULL)
  92. ENGINE = InnoDB
  93. DEFAULT CHARACTER SET = utf8;

发表评论

表情:
评论列表 (有 0 条评论,132人围观)

还没有评论,来说两句吧...

相关阅读