1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<?php
declare(strict_types=1);
namespace Kreait\Firebase\Auth;
final class SignInWithIdpCredentials implements IsTenantAware, SignIn
{
private string $provider;
private ?string $accessToken = null;
private ?string $idToken = null;
private ?string $linkingIdToken = null;
private ?string $oauthTokenSecret = null;
private ?string $rawNonce = null;
private string $requestUri = 'http://localhost';
private ?TenantId $tenantId = null;
private function __construct(string $provider)
{
$this->provider = $provider;
}
public static function withAccessToken(string $provider, string $accessToken): self
{
$instance = new self($provider);
$instance->accessToken = $accessToken;
return $instance;
}
public static function withAccessTokenAndOauthTokenSecret(string $provider, string $accessToken, string $oauthTokenSecret): self
{
$instance = self::withAccessToken($provider, $accessToken);
$instance->oauthTokenSecret = $oauthTokenSecret;
return $instance;
}
public static function withIdToken(string $provider, string $idToken): self
{
$instance = new self($provider);
$instance->idToken = $idToken;
return $instance;
}
public function withRawNonce(string $rawNonce): self
{
$instance = clone $this;
$instance->rawNonce = $rawNonce;
return $instance;
}
public function withLinkingIdToken(string $idToken): self
{
$instance = clone $this;
$instance->linkingIdToken = $idToken;
return $instance;
}
public function withRequestUri(string $requestUri): self
{
$instance = clone $this;
$instance->requestUri = $requestUri;
return $instance;
}
public function withTenantId(TenantId $tenantId): self
{
$action = clone $this;
$action->tenantId = $tenantId;
return $action;
}
public function provider(): string
{
return $this->provider;
}
public function oauthTokenSecret(): ?string
{
return $this->oauthTokenSecret;
}
public function accessToken(): ?string
{
return $this->accessToken;
}
public function idToken(): ?string
{
return $this->idToken;
}
public function rawNonce(): ?string
{
return $this->rawNonce;
}
public function linkingIdToken(): ?string
{
return $this->linkingIdToken;
}
public function requestUri(): string
{
return $this->requestUri;
}
public function tenantId(): ?TenantId
{
return $this->tenantId;
}
}