You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
2.2 KiB

  1. # ===============================================
  2. # AUTHENTICATION
  3. # ===============================================
  4. extend type Query {
  5. authentication: AuthenticationQuery
  6. }
  7. extend type Mutation {
  8. authentication: AuthenticationMutation
  9. }
  10. # -----------------------------------------------
  11. # QUERIES
  12. # -----------------------------------------------
  13. type AuthenticationQuery {
  14. strategies(
  15. isEnabled: Boolean
  16. ): [AuthenticationStrategy]
  17. }
  18. # -----------------------------------------------
  19. # MUTATIONS
  20. # -----------------------------------------------
  21. type AuthenticationMutation {
  22. login(
  23. username: String!
  24. password: String!
  25. strategy: String!
  26. ): AuthenticationLoginResponse @rateLimit(limit: 5, duration: 60)
  27. loginTFA(
  28. loginToken: String!
  29. securityCode: String!
  30. ): DefaultResponse @rateLimit(limit: 5, duration: 60)
  31. register(
  32. email: String!
  33. password: String!
  34. name: String!
  35. ): AuthenticationRegisterResponse
  36. updateStrategies(
  37. strategies: [AuthenticationStrategyInput]!
  38. config: AuthenticationConfigInput
  39. ): DefaultResponse @auth(requires: ["manage:system"])
  40. }
  41. # -----------------------------------------------
  42. # TYPES
  43. # -----------------------------------------------
  44. type AuthenticationStrategy {
  45. isEnabled: Boolean!
  46. key: String!
  47. props: [String]
  48. title: String!
  49. description: String
  50. isAvailable: Boolean
  51. useForm: Boolean!
  52. logo: String
  53. color: String
  54. website: String
  55. icon: String
  56. config: [KeyValuePair] @auth(requires: ["manage:system"])
  57. selfRegistration: Boolean!
  58. domainWhitelist: [String]! @auth(requires: ["manage:system"])
  59. autoEnrollGroups: [Int]! @auth(requires: ["manage:system"])
  60. }
  61. type AuthenticationLoginResponse {
  62. responseResult: ResponseStatus
  63. jwt: String
  64. tfaRequired: Boolean
  65. tfaLoginToken: String
  66. }
  67. type AuthenticationRegisterResponse {
  68. responseResult: ResponseStatus
  69. jwt: String
  70. }
  71. input AuthenticationStrategyInput {
  72. isEnabled: Boolean!
  73. key: String!
  74. config: [KeyValuePairInput]
  75. selfRegistration: Boolean!
  76. domainWhitelist: [String]!
  77. autoEnrollGroups: [Int]!
  78. }
  79. input AuthenticationConfigInput {
  80. audience: String!
  81. tokenExpiration: String!
  82. tokenRenewal: String!
  83. }