Using version ~2.0#dev for yiisoft/yii2-jui ./composer.json has been
updated Loading composer repositories with package information
Updating dependencies (including require-dev)
Could not fetch https://api.github.com/repos/jquery/jquery, enter your
GitHub credentials to go over the API rate limit A token will be
created and stored in
"C:/Users/nimmy/AppData/Roaming/Composer/auth.json", your password
will never be stored To revoke access to this token you can visit
https://github.com/settings/applications Username:
I am getting above error while I try to install yii2/jui. I want do use a datepicker. I tried to install datepicker and composer also, but I am getting the same error.
What could I try next?
You should try composer self-update. Then run update again. Keep in mind, that GitHub imposes a limit of 60 requests per hour for unauthorized user's IP!
By entering your credentials, or alternatively it may ask you for your Authorization Token (which you can generate inside GitHub and provide to composer when prompted for it), you should extend your limit to 5000 requests per hour.
If everything is done correctly, but composer keeps saying that the Authentication Token is wrong, try making a new GitHub account and try updating again providing the credentials for the new account. In the past I had a problem when an account had the wrong authorized requests counter stored by GitHub which was counting all requests as unauthorized, making new account worked like a charm, although figuring out the problem and reporting it worked also ;)
Related
Im trying to install passport on my Laravel 9 project, but I get that error
Could not fetch https://gitlab.com/api/v4/projects/stella-maris%2Fclock/repository/archive.zip?sha=8a0a967896df4c63417385dc69328a0aec84d9cf, enter your gitlab.com credentials to go over the API rate limit I tryed to access this url but is blocked for me. How can I solve it.
This policy has been active at Github a long time regrettably. It is documented here and you can see your current status at https://api.github.com/rate_limit in the core section
Also see https://developer.github.com/v3/#rate-limiting:
There is nothing Composer can do to circumvent that, hence why it throws the verbose error:
Create a GitHub OAuth token to go over the API rate limit
You can do this at https://github.com/settings/tokens, and it needs to be done only once per installation as Composer remembers the token for subsequent requests.
Thanks, I solve it by connecting myself through a proxy server.
i'm using Larave 5.4 passport to create SPA application. However, i was able to make authentication work. but access token are always short-lived tokens with 600s expiration time.
i could not increase expiration time with:
Passport::tokensExpireIn(Carbon::now()->addDays(15));
Passport::refreshTokensExpireIn(Carbon::now()->addDays(30));
it have no effect at all.
any help? thanks in advance.
Personal access tokens are always long-lived. Their lifetime is not modified when using the tokensExpireIn or refreshTokensExpireIn methods - as explained in Laravel's official documentation (https://laravel.com/docs/5.7/passport#personal-access-tokens).
The option of editing PassportServiceProvider.php in the vendor directory is a bad idea. Every time, you make an update (e.g composer update/install) or by another developer in production, code will be reverted to status quo, and it would start failing.
A better approach is to use Password Grant Tokens. The OAuth2 password grant allows your other first-party clients, such as a mobile application, to obtain an access token using an e-mail address / username and password. This allows you to issue access tokens securely to your first-party clients without requiring your users to go through the entire OAuth2 authorization code redirect flow. Be sure that you have duly installed passport (See Guide: https://laravel.com/docs/5.7/passport#installation), then run this command
php artisan passport:client --password
Having done this, you can request an access token by issuing a POST request to /oauth/token. Remember, this route is already registered by the Passport::routes method so there is no need to define it manually. If the request is successful, you will receive an access_token and refresh_token in the JSON response from the server. See payload sample below:
{
"grant_type" : "password",
"client_id":"your-client-id",
"client_secret":"your-client-secret",
"username":"twady77#gmail.com",
"password":"123456",
"scope":""
}
Sample response:
{
"token_type":"Bearer",
"expires_in":1296000,
"access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjVkMWJjN2NhOTU0ZWU2YTZmOGNkMGEyOTFjOTI5YzU4Zjk3ODk3M2YxZDJmNjQ2NjkyZjhjODQyZjYxNTBjZGRiYzMwY2RjMzRmZjJhYmU1In0.eyJhdWQiOiI4IiwianRpIjoiNWQxYmM3Y2E5NTRlZTZhNmY4Y2QwYTI5MWM5MjljNThmOTc4OTczZjFkMmY2NDY2OTJmOGM4NDJmNjE1MGNkZGJjMzBjZGMzNGZmMmFiZTUiLCJpYXQiOjE1NDkyOTI5MjcsIm5iZiI6MTU0OTI5MjkyNywiZXhwIjoxNTUwNTg4OTI3LCJzdWIiOiIxIiwic2NvcGVzIjpbXX0.cSvu30xAT-boA5zmVuxTr0TfH_5MYuVWYi6NVQRbryZSswt8EAFTi5QXHH1f0O63DWnLA6VFBS2AfDe4-ryJZACDnt4gtPJOeuu1rNMZ53MU1vjxnyC8FsYz8v9vmYJsZPKqfTJpuJFYRFh7kkV7uWAmrEkuF3POnDn-GjW50f4i26lIZW5ta5j4nZQrIJCQUEzwXaQtn9H-qef3bTWAaplWaV-k7Blic-0TXXVfWa_CdoKCAzHROVBRWY1Idhe1LJkvGKldUGzUfliiB1x7EVVInq94VYEP5d9__90Z2UMUn5dCEgWkXvcEHYy87_4OSwu4TQk_f3hD82OVOEtJGgPyJqK51WqnQCBYwNtxNjqAW2oaMgpritp3G8nccUiyhkE4Pd_kj3cb2OvSNRXdDS9z-RnJb1OXUkja-4Xe_JfIWUjlTnkss18xMg89hcU_3xtBwUXBWHgffzcbNoI1oOwUL6Whekduiy8csf665v0cnzkPXISmvyGhiMseIlBEN9m9uESaJqD_g7WzbsEs7meI0CAF3230UgrI1MdYSAJMW0mMPF9EScH31a_Qpde5O233Ty6-S4NAp323Wneqs_jpGSfw81CvoI1JeY0hZccRC-MBBsQ2Ox7AM36H5L3p-ybricmT3oCcHEqhufq-ygyfqk1RufJwwRblwYPyaJE",
"refresh_token":"def50200c6b2378110190ac28d9d55f622885bb0b470a20543a6f1eefb18ed93c57b7040dc4db9444aa8853209bde9d5443a407d43fcaf1deb2e1f3f5ea3ce7431c4ec5e111bdc0cc71ca76034cd2a884441c51e4c922dddfa3f6e3a3fa8e1fbb8efe4581ce70d76590e732b3fa8b0c41a8abff4a8759f9dd1cc3ae46134fb67a8f25cd79e3229f6ee3238701ebfe0e8b0e2f14bd13c7fde3f813708a3de9928c8e992850994ca97bf61984cdb846bd0d72916312d9985472fc4293a3b3f2c55e1ef19621ef009623a6780f800ece9c8d835871dc795fda5daa43ac3fdae467e66b46e4eb73d53b8cb821522ee60979711c28c54fb2085f6000ac7e96e019ce51b9f92ea3fa2028aa0238fc3dca9c900e8dd77907782b22482f95a5e55708e5bda8c28f3732ff55e361f08447b33fe05d5646cecfb9faed462d327efdcc2a3742f46f9f825275d296b4ced25c05f3b6add68f43a2b448e4523d5410c631dc45bba"
}
Try to use this library: https://github.com/GeneaLabs/laravel-caffeine , and you can look laravel session config options
tokenExpireIn() instead of refreshTokensExpireIn() use then solve tokenExpireIn problem.
for passport grant token
Passport::tokensExpireIn(Carbon::now()->addDays(10));
Passport::refreshTokensExpireIn(Carbon::now()->addDays(15));
This is only adding 10 minutes of expiry time. Don't know how and why, but instead changing internal codes. I Changed
Passport::tokensExpireIn(Carbon::now()->addDays(10000));
Passport::refreshTokensExpireIn(Carbon::now()->addDays(12000));
Now it's adding 7 days of expiry time. Seems like addDays function adding 10000 minutes.
I have the same issue before for my application, I spent two days try to find what is the problem, The best solution that I came up with is to change the expire date directly in the PassportServiceProvider
Go to vendor/laravel/passport/src/PassportServiceProvider.php line 108
new PersonalAccessGrant, new DateInterval('P1Y')
for example to set the expire date to one week
new PersonalAccessGrant, new DateInterval('P1W')
I know this is a bad solution for fixing the issue, recently I have found the same issue on Laravel Git repo
https://github.com/laravel/passport/issues/47
I was able to successfully log in using Google Classroom and pull the course data during the trial. This was on my local machine. Now I have moved to my test server. I can still log in via google but can no longer pull the course data. I have already updated my client_secret file (updated the appropriate endpoints) but i get the following error after calling classroom.courses.list
Error: No access or refresh token is set.
Would appreciate anyone's help. I do have Google Classroom API as one of my APIs. Not sure if it's because i'm now on a domain instead of my localhost.
Sadly, I was doing a 2 part registration. The first past, I was setting the token. When the page was submitted again with new details from the user, when I was making the call to google, I hadn't set the token.
I installed TeamCity on Windows Server 2012. It has been working fine setting up a few builds. I then attempted to install some plugins by putting .zip files in the ~/.BuildServer/plugins folder. I restarted the server by cd'ing to c:\TeamCity\bin and running "runAll stop" followed by "runAll start".
Then when I go to the teamcity page for several minutes I get a "Enter the maintenance authentication token" page. It says on the page to find the maintenance token in the teamcity-server.log file (see screenshot below). I look in c:\TeamCity\logs\teamcity-server.log and it has several "super user token" and "agent authorizationtoken". I tried using these token but get an invalid maintenance token error.
So my question is where do I find the maintenance token?
Edit: This has resolved itself for me since upgrading to the latest TeamCity version. None of the suggested answers worked at the time I had this problem so that's why I am not marking anything as the accepted answer.
Please check out file teamcity-winservice.log in logs subfolder of your Teamcity.
Auth token should be here.
open cmd goto TeamCity instalation folder
C:\TeamCity\bin
type
runAll.bat stop
wait until services stoped then type
runAll.bat start
u will see current authentication token in console,.
It should be in the file teamcity-server.log which is in the logs subfolder of your TeamCity installation - look for the text "Administrator login is required from web UI using authentication token" and a long number afterwards which is your token.
Also see the docs for TeamCity Maintenance Mode.
Had the same issue it is the Superuser token you want (it will be the last line in the log unless you have tried to login - which will show in here as failures)
Along the lines of
Administrator can login from web UI using authentication token: 1234567890
/Edited so line in log file is more obviously a quote and added an example token thanks #Kleopatra,
Took me a while to find it, but it's in the file as indicated, but it's the very last line.
if you are hitting on this issue https://youtrack.jetbrains.com/issue/TW-43100 in TeamCity (v10.0.4) for IE, you may need to enable javascript and also add the url to IE trusted site list.
If you cannot find in the log, just type a random value. The web ui will inform you that entered an invalid token.
Afterwards go to the log (TeamCity/logs/teamcity-server.log) and check the last line:
[2018-03-27 17:55:20,258] WARN - jetbrains.buildServer.STARTUP - Failed maintenance authentication from IP address /86.234.23.62 with token: "6056431478480274143". Current authentication token: "6418830881320521552"
I tried restarting the Teamcity service.
I tried the runAll stop start thing.
Didn't work for me.
I rebooted then found the superuser token in TeamCity/logs/teamcity-server.log
You will find multiple super user authentication token in the file specified (TeamCity\logs\teamcity-server). You can always use the last one in the file. (if there is not one in the last line, try logon with random number, you can get an authorization failed message with the token number included and it will be added to the file)
I am just following instructions from the yii website and don't really understand composer. I followed the instructions from here http://www.yiiframework.com/doc-2.0/guide-start-installation.html
The authentication seems to be working but then it prompts me for the username/password again and again.
Anyone got some things I can check to see why it keeps prompting?
[root#dndbox html]# composer create-project --prefer-dist --stability=dev yiisoft/yii2-app-basic basic
Installing yiisoft/yii2-app-basic (dev-master b528289495bf9721d2b8c628d69caad42e45b0ce)
- Installing yiisoft/yii2-app-basic (dev-master master)
Downloading: connection...
Could not fetch https://api.github.com/repos/yiisoft/yii2-app-basic/zipball/b528289495bf9721d2b8c628d69caad42e45b0ce, enter your GitHub credentials to go over the API rate limit
The credentials will be swapped for an OAuth token stored in /root/auth.json, your password will not be stored
To revoke access to this token you can visit https://github.com/settings/applications
Username: *.com
Password:
An existing OAuth token for Composer is present and will be reused
Could not fetch https://api.github.com/authorizations, enter your GitHub credentials to go over the API rate limit
The credentials will be swapped for an OAuth token stored in /root/auth.json, your password will not be stored
To revoke access to this token you can visit https://github.com/settings/applications
Username: *.com
Password:
An existing OAuth token for Composer is present and will be reused
Could not fetch https://api.github.com/authorizations, enter your GitHub credentials to go over the API rate limit
The credentials will be swapped for an OAuth token stored in /root/auth.json, your password will not be stored
To revoke access to this token you can visit https://github.com/settings/applications
Username:
==================================== EDIT 1 =====================================
If I visit the URL provided I get a error message in the json, https://api.github.com/authorizations
{
"message": "API rate limit exceeded for xxx.xxx.xxx.26. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)",
"documentation_url": "https://developer.github.com/v3/#rate-limiting"
}
It may helps you more. Follow the steps:
Create/Sign in into github account.
Go to Profile>>Settings>>Personal access tokens (OR) click on this https://github.com/settings/tokens.
Click on Generate new token
Select the appropriate scopes and click Generate token.
Copy the the token Key and past it in composer when the composer want you the Token(like: Token (Hidden):)
Now it will enter into the installation process.
Good Luck...
see this answer on the forum
http://www.yiiframework.com/forum/index.php/topic/60340-issue-while-installing-yii-2/page__view__findpost__p__269389
it helped me
Create a Github account.
Go to https://github.com/s...gs/applications and delete your previous token generated during the installation of yii2
Create a new token.
Run this: composer config -g github-oauth.github.com
Retry again with the yii2 installation