Instance from an AuthCode.
Source
ManagedToken.fromCode(AuthCode code) : super() {
var tokenResourceOwner = this
.entity
.relationships["resourceOwner"]
.destinationEntity
.newInstance();
tokenResourceOwner["id"] = code.resourceOwnerIdentifier;
this
..code = code.code
..resourceOwner = tokenResourceOwner as dynamic
..issueDate = code.issueDate
..expirationDate = code.expirationDate
..scope = code.requestedScopes?.map((s) => s.scopeString)?.join(" ")
..client = (new ManagedClient()..id = code.clientID);
}