Tools and information for 3rd party integrators

OpenID Connect

SmartCentral supports the OpenID Connect specification as an Identity Provider.

Resources for specifications and sample code libraries:
* http://openid.net/connect/
* https://github.com/IdentityServer/IdentityServer4.Samples/tree/release/Quickstarts

FAQ

Our OpenID entry point for staging is:
* http://test.smartcentral.net/authorizations/new/

To get JWK public keys :
* http://test.smartcentral.net/jwks.json

Create your own test account :
* http://test.smartcentral.net/user/new/

Implicit flow

  • 3rd party sends authorisation request

http://test.smartcentral.net/authorizations/new/?client_id=fancy_app&response_type=id_token%20token&scope=openid%20email&nonce=1234&redirect_uri=http://localhost:3001/auth

  • SmartCentral redirects end user to login page if not logged in, after end user’s authorisation, send the following fields (http form fields encoded) to redirect_uri provided by 3rd party.

    • access_token
    • id_token
    • token_type
  • After 3rd party received id_token (JWT format), the id token should be verified using the public key provided by SmartCentral http://test.smartcentral.net/jwks.json

  • To get readble information of the user, 3rd party sends GET request with access token returned by SmartCentral to http://test.smartcentral.net/user_info?access_token=abcd

  • User info returns the following fields:

    • subject (SmartCentral user unique id)
    • name
    • email

GraphQL

SmartCentral has implemented GraphQL to support an extensible integration method for api access to centre data.

Graphql is currently implemented with persistent token based authentication for fast server to server comms.

Contact us for end points and authentication when you are ready.

Schema

type service (id){
  id: ID
  type: String
  name: String
	enrolments: [enrolment]
	sessions(date): [session]
/* a time component may be optionally included "2020-08-06T17:00:01" in the parameter
}

type enrolment{
  id: ID
	child: child
	parent1: parent
	parent2: parent
	bookings: [booking]
	startDate: String
	endDate: String
	status: String

}
/* Date strings are 10 char ISO dates in tz of centre
/* Status values are : 'Exited' , 'Not yet submitted' , Active 
/* Status = 'Active' covers all internal values that dont
/* fall in other 2

type child{
	id: ID
	firstName: String
	lastName: String
	dateOfBirth : Date
	gender : string
	instructions: [instruction]
}

/* gender is a 1 char field 'm' or 'f'

type parent{
  id: ID
	firstName: String
	lastName: String
	email: String
	phone: String
}


type booking{
	day: String
	room: String
}

/* "day" is a 3 character abreviation of day of the week MON , TUE, WED , THU , FRI , SAT , SUN
/* week starts on MON and ends on SUN

type instruction{
  category: String
  description: String
}

type session{
          enrolmentId: ID;
          room: String;
          startTime: String;
          endTime: String;
          absent: Boolean;
        }
/* time is passed as hh:mm:ss in local time of the centre

Sample Query 1

{
  "query": "{
    service(id: 1) {
      id
        enrolments {
          child {
            id
            firstName
            lastName
          }
          parent1 {
	          id
            firstName
            lastName
            email
          }
          parent2 {
            id
            firstName
            lastName
            email
          }
		  startDate
		  status
		  bookings {
			day             
			room
		  }
        }
    }
  }"
}

Sample Query 2

{
  "query": "{
    service(id: 472) {
      id
      enrolments {
        child {
          id
          firstName
          lastName
        }
        parent1 {
          id
          firstName
          lastName
          email
        }
        parent2 {
          id
          firstName
          lastName
          email
        }
        startDate
        status
        endDate
        bookings {
          day
          room
        }
        sessions(date: \"2020-08-06T17:00:01Z\") {
          room
          startTime
          endTime
          absent
        }
      }
    }
  }"
}

Sample Query 3

{

  "query": "{

    service(id: 979) {
      id
      sessions(date: \"2020-08-11\") {
        enrolmentId
        room
        startTime
        endTime
        absent
      }

      enrolments {
          id
          child {
             id
             firstName
             lastName
             dateOfBirth
          }
        }
    }
  }"
}

Sample Query 4

{

  "query": "{
    service(id: 979) {
      id
      sessions(date: \"2020-08-11\") {
          enrolmentId
          room
          startTime
          endTime
          absent
      }
        enrolments {
          id
          child {
            id
            firstName
            lastName
            dateOfBirth
          }
          parent1 {
          id
          firstName
          lastName
          email
          phone
        }
        parent2 {
          id
          firstName
          lastName
          email
          phone
        }
      }
    }
  }"
}