blob: 4d12757e52042f268fb2ba4ed0877a0f5bf9eab7 [file] [log] [blame]
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SERVICES_IDENTITY_PUBLIC_CPP_ACCESS_TOKEN_INFO_H_
#define SERVICES_IDENTITY_PUBLIC_CPP_ACCESS_TOKEN_INFO_H_
#include <string>
#include "base/macros.h"
#include "base/time/time.h"
namespace identity {
// Container for a valid access token plus associated metadata.
struct AccessTokenInfo {
// The access token itself.
std::string token;
// The time at which this access token will expire.
base::Time expiration_time;
// Contains extra information regarding the user's currently registered
// services. It is uncommon for consumers to need to interact with this field.
// To interact with it, first parse it via gaia::ParseServiceFlags().
std::string id_token;
AccessTokenInfo() = default;
AccessTokenInfo(const std::string& token_param,
const base::Time& expiration_time_param,
const std::string& id_token)
: token(token_param),
expiration_time(expiration_time_param),
id_token(id_token) {}
};
// Defined for testing purposes only.
bool operator==(const AccessTokenInfo& lhs, const AccessTokenInfo& rhs);
} // namespace identity
#endif // SERVICES_IDENTITY_PUBLIC_CPP_ACCESS_TOKEN_INFO_H_