My project is very similar to the famous ATM problem. I have to create a hotel check in/check out system. I have to get the user input for the last name and confirm it. However when I try to return the string, it tells me it cant convert string to int.

```
import java.util.Scanner;

public class Keyboard {
   private Scanner input;
   String lastName;

   public Keyboard() {
       input = new Scanner( System.in);
   }

   public int getInput() {
       lastName = input.nextLine();
       return lastName;
   }

}

```
['https://Stackoverflow.com/questions/50219323', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9732237/']
The problem is that your server time is different from Google server time. And when you validate received token from google it might be that token will be valid in 1 or n seconds. That's why you get an error `JWT not yet valid`

To fix it you can synchronize time of your server with google server time. Google doc how to do this is <https://developers.google.com/time/>
You can configure the system time as per google or if your computer is part of a domain and you don't want to change the domain controller config, then you can pass a clock object in the Validateasync method like this:

```
var googleUser = await GoogleJsonWebSignature.ValidateAsync(token, new GoogleJsonWebSignature.ValidationSettings()
            {
                Clock = new clock(),
                Audience = new[] { "your client id" }
            });

```

For this, you need to make a class implementing the IClock interface as below:

```
 public class clock : IClock
        {
            public DateTime Now => DateTime.Now.AddMinutes(5);

            public DateTime UtcNow => DateTime.UtcNow.AddMinutes(5);
        }

```

In this, you can set the time accordingly like if my system time is 5 min. ahead of google time, I'll add 5 min., then your token will be successfully validated.

And to check the google time, you can make use of JwtSecurityTokenHandler class like:

```
var handler = new JwtSecurityTokenHandler();
var tokenS = handler.ReadToken(token) as JwtSecurityToken;

```

in tokenS, you will have a property as issued at which will provide the UTC time, if you want local time then you can use `toLocal()` method on that property and compare that time to your system's time.