authentication.graphql 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. regenerateCertificates: DefaultResponse @auth(requires: ["manage:system"])
  41. resetGuestUser: DefaultResponse @auth(requires: ["manage:system"])
  42. }
  43. # -----------------------------------------------
  44. # TYPES
  45. # -----------------------------------------------
  46. type AuthenticationStrategy {
  47. isEnabled: Boolean!
  48. key: String!
  49. props: [String]
  50. title: String!
  51. description: String
  52. isAvailable: Boolean
  53. useForm: Boolean!
  54. logo: String
  55. color: String
  56. website: String
  57. icon: String
  58. config: [KeyValuePair] @auth(requires: ["manage:system"])
  59. selfRegistration: Boolean!
  60. domainWhitelist: [String]! @auth(requires: ["manage:system"])
  61. autoEnrollGroups: [Int]! @auth(requires: ["manage:system"])
  62. }
  63. type AuthenticationLoginResponse {
  64. responseResult: ResponseStatus
  65. jwt: String
  66. tfaRequired: Boolean
  67. tfaLoginToken: String
  68. }
  69. type AuthenticationRegisterResponse {
  70. responseResult: ResponseStatus
  71. jwt: String
  72. }
  73. input AuthenticationStrategyInput {
  74. isEnabled: Boolean!
  75. key: String!
  76. config: [KeyValuePairInput]
  77. selfRegistration: Boolean!
  78. domainWhitelist: [String]!
  79. autoEnrollGroups: [Int]!
  80. }
  81. input AuthenticationConfigInput {
  82. audience: String!
  83. tokenExpiration: String!
  84. tokenRenewal: String!
  85. }