authentication.graphql 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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
  27. loginTFA(
  28. loginToken: String!
  29. securityCode: String!
  30. ): DefaultResponse
  31. register(
  32. email: String!
  33. password: String!
  34. name: String!
  35. ): AuthenticationRegisterResponse
  36. updateStrategies(
  37. strategies: [AuthenticationStrategyInput]
  38. ): DefaultResponse @auth(requires: ["manage:system"])
  39. }
  40. # -----------------------------------------------
  41. # TYPES
  42. # -----------------------------------------------
  43. type AuthenticationStrategy {
  44. isEnabled: Boolean!
  45. key: String!
  46. props: [String]
  47. title: String!
  48. description: String
  49. useForm: Boolean!
  50. logo: String
  51. color: String
  52. website: String
  53. icon: String
  54. config: [KeyValuePair] @auth(requires: ["manage:system"])
  55. selfRegistration: Boolean!
  56. domainWhitelist: [String]! @auth(requires: ["manage:system"])
  57. autoEnrollGroups: [Int]! @auth(requires: ["manage:system"])
  58. }
  59. type AuthenticationLoginResponse {
  60. responseResult: ResponseStatus
  61. jwt: String
  62. tfaRequired: Boolean
  63. tfaLoginToken: String
  64. }
  65. type AuthenticationRegisterResponse {
  66. responseResult: ResponseStatus
  67. jwt: String
  68. }
  69. input AuthenticationStrategyInput {
  70. isEnabled: Boolean!
  71. key: String!
  72. config: [KeyValuePairInput]
  73. selfRegistration: Boolean!
  74. domainWhitelist: [String]!
  75. autoEnrollGroups: [Int]!
  76. }