19 SELECT s.
scope FROM token_scope ts
INNER JOIN scope s
USING (scope_id
)
20 WHERE ts.code_id
= t.code_id
23 INNER JOIN profile p
USING (profile_id
)
24 INNER JOIN authentication a
USING (identifier_id
)
25 WHERE a.identifier
= $
(identifier
)
26 ORDER BY GREATEST(t.created
, t.refreshed
) DESC