Use omniauth-owa gem (wot I just rit)