zoukankan      html  css  js  c++  java
  • oauth2的数据库设计

    CREATE TABLE `oauth_client_details` (
    `client_id` varchar(255) NOT NULL,
    `resource_ids` varchar(255) DEFAULT NULL,
    `client_secret` varchar(255) DEFAULT NULL,
    `scope` varchar(255) DEFAULT NULL,
    `authorized_grant_types` varchar(255) DEFAULT NULL,
    `web_server_redirect_uri` varchar(255) DEFAULT NULL,
    `authorities` varchar(255) DEFAULT NULL,
    `access_token_validity` int(11) DEFAULT NULL,
    `refresh_token_validity` int(11) DEFAULT NULL,
    `additional_information` text,
    `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `archived` tinyint(1) DEFAULT '0',
    `trusted` tinyint(1) DEFAULT '0',
    `autoapprove` varchar(255) DEFAULT 'false',
    PRIMARY KEY (`client_id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

    CREATE TABLE `oauth_access_token` (
    `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `token_id` varchar(255) DEFAULT NULL,
    `token` blob,
    `authentication_id` varchar(255) DEFAULT NULL,
    `user_name` varchar(255) DEFAULT NULL,
    `client_id` varchar(255) DEFAULT NULL,
    `authentication` blob,
    `refresh_token` varchar(255) DEFAULT NULL,
    KEY `token_id_index` (`token_id`),
    KEY `authentication_id_index` (`authentication_id`),
    KEY `user_name_index` (`user_name`),
    KEY `client_id_index` (`client_id`),
    KEY `refresh_token_index` (`refresh_token`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

    CREATE TABLE `oauth_code` (
    `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `code` varchar(255) DEFAULT NULL,
    `authentication` blob,
    KEY `code_index` (`code`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

    CREATE TABLE `oauth_refresh_token` (
    `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `token_id` varchar(255) DEFAULT NULL,
    `token` blob,
    `authentication` blob,
    KEY `token_id_index` (`token_id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

    CREATE TABLE `order_traveller` (
    `orderId` varchar(32) NOT NULL DEFAULT '',
    `travellerId` varchar(32) NOT NULL DEFAULT '',
    PRIMARY KEY (`orderId`,`travellerId`),
    KEY `travellerId` (`travellerId`),
    CONSTRAINT `order_traveller_ibfk_1` FOREIGN KEY (`orderId`) REFERENCES `orders` (`id`),
    CONSTRAINT `order_traveller_ibfk_2` FOREIGN KEY (`travellerId`) REFERENCES `traveller` (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

  • 相关阅读:
    oracle的分析函数over 及开窗函数
    ASP.NET中分布式事务的使用
    后台实现显示欢迎用户登陆的方法
    AjaxHelper的get和post请求的封装类
    登陆权限验证Session和Cookie用法及BasePage类使用
    四个常用.NET的SqlHelper的方法
    ASP.NET在实际开发中验证码的用法
    SQL Server事务的存储过程
    利用JQuery实现全选和反选的几种方法
    JS中表格的全选和删除要注意的问题
  • 原文地址:https://www.cnblogs.com/zxy-come-on/p/14047791.html
Copyright © 2011-2022 走看看