chromium/google_apis/gaia/oauth2_id_token_decoder.cc

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "google_apis/gaia/oauth2_id_token_decoder.h"

#include <memory>
#include <optional>
#include <string_view>

#include "base/base64url.h"
#include "base/containers/contains.h"
#include "base/json/json_reader.h"
#include "base/logging.h"
#include "base/strings/string_split.h"
#include "base/values.h"

namespace {

// The name of the service flag that defines the account is Unicorn.
const char kChildAccountServiceFlag[] =;

// The name of the service flag that defines the account is in advanced
// protection program.
const char kAdvancedProtectionAccountServiceFlag[] =;

// The key indexing service flags in the ID token JSON.
const char kServicesKey[] =;

// Decodes the JWT ID token to a dictionary. Returns whether the decoding was
// successful.
std::optional<base::Value::Dict> DecodeIdToken(const std::string id_token) {}

// Obtains a vector of service flags from the encoded JWT ID token. Returns
// whether decoding the ID token and obtaining the list of service flags from it
// was successful.
bool GetServiceFlags(const std::string id_token,
                     std::vector<std::string>* out_service_flags) {}

}  // namespace

namespace gaia {

TokenServiceFlags ParseServiceFlags(const std::string& id_token) {}

}  // namespace gaia