dqxboe2628 2015-09-22 17:29
浏览 252
已采纳

OAuth2 client_secret列不允许为null

Why is in this OAuth database scheme from Brent Shaffer the client_secret column not allowed to be null (client_secret VARCHAR(80) NOT NULL)? Is this the common configuration for a valid OAuth database schema?

The OAuth2-Server Module can also be found on GitHub but also in the PDO scheme there the client_secret column is set NOT NULL.

CREATE TABLE oauth_clients (
  client_id VARCHAR(80) NOT NULL, 
  client_secret VARCHAR(80) NOT NULL, 
  redirect_uri VARCHAR(2000) NOT NULL, 
  grant_types VARCHAR(80), 
  scope VARCHAR(100), 
  user_id VARCHAR(80), 
  CONSTRAINT clients_client_id_pk PRIMARY KEY (client_id)
);

It is quite common to have public clients that don't need a password. I see that people set an empty string('') in such cases, but a null values seems much cleaner to me.

Is there some special reason to prohibit null values in this case?

  • 写回答

1条回答 默认 最新

  • duan198123 2015-09-24 07:01
    关注

    I got an answer on GitHub: "NULL is fine for client_secret".

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看