当前位置: 首页 > 知识库问答 >
问题:

为什么我在Maven中会出现“401未授权”错误?

高豪
2023-03-14

为什么我在Maven中会出现“401未授权”错误?

以下是调用mvn deploy(底部为完整日志)时出现的错误:

[INFO]生成失败
[ERROR]无法执行目标org.apache.maven.plugins:maven-deploy-plugin:2.7:在项目上部署(default-deploy)xbnjava:无法部署项目:无法传输项目com.github.aliteralmind:xbnjava:pom:0.1.2 from/to sonatype-nexus-staging(https://oss.sonatype.org/service/local/staging/deploy/maven2/):无法传输文件:https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/XBNJava/0.1.2/XBNJava-0.1.2.pom。返回代码为:401,ReasonPhrase:未授权.->[帮助1]

根据这个sonatype支持页面:

“如果您收到401,那是因为maven发送了错误的登录凭据,或者根本没有凭据。”

下面是我采取的步骤,下面是我完整的settings.xmlpom.xml文件,下面是mvn deploymvn deploy-e的完整日志。

  • 我使用settings.xml中的用户/pass成功地登录和退出了sonatype.org网站。
  • 我尝试使用curl手动部署工件,使用命令

[C:\]curl-u my_sonatype_dot_com_username:my_sonatype_dot_com_password https://oss.sonatype.org/content/repositories/snapshots/com/github/aliteralmind/xbnjava/0.1.2-snapshot/xbnjava-0.1.2-20140716.224928-1.pom--request put--data@pom.xml

但出现了以下错误:

Warning: Couldn't read data from file "pom.xml", this makes an empty POST.
curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.

我使用-k选项再次运行它,这次只得到了以下结果:

Couldn't read data from file "pom.xml", this makes an empty POST.

我以前从未使用过curl,所以我对如何处理这些信息感到茫然。

核对表项目2。如果没有错误输出,请确保在服务器上正确配置了用户特权。请确保删除您刚刚创建的回购。

    null

核对表项目3。确保您已经在settings.xml中配置了服务器,并且服务器id与pom.xml中的分发存储库id相同。

  • settings.xml中,settings/servers/server/id等于ossrh
  • pom.xml中,distributionmanagement/snapshotrepository/id等于ossrh

(完整文件在底部)

核对表项目4。确保settings.xml位于正确的位置(通常是_~/.m2/settings.xml)。您可以通过运行mvn help:effective-settings来检查这一点。

根据Maven的settings参考,settings.xml必须位于以下两个位置之一:

  • Maven安装:$M2_HOME/conf/settings.xml
  • 用户的安装:${user.home}/.m2/settings.xml
    null
[C:\applications\utilities\curl]
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-help-plugin:2.2:effective-settings (default-cli) @ standalone-pom ---
[INFO]
Effective user-specific configuration settings:

<?xml version="1.0" encoding="UTF-8"?>
<!-- ====================================================================== -->
<!--                                                                        -->
<!-- Generated by Maven Help Plugin on 2014-07-18T12:48:19                  -->
<!-- See: http://maven.apache.org/plugins/maven-help-plugin/                -->
<!--                                                                        -->
<!-- ====================================================================== -->

<!-- ====================================================================== -->
<!--                                                                        -->
<!-- Effective Settings for 'jeffy' on 'kermit-the-frog'                    -->
<!--                                                                        -->
<!-- ====================================================================== -->

<settings xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:sc
hemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
  <localRepository xmlns="http://maven.apache.org/SETTINGS/1.1.0">C:\Users\jeffy\.m2\repository</localRepository
>
  <servers xmlns="http://maven.apache.org/SETTINGS/1.1.0">
    <server>
      <username>MY_SONATYPE_DOT_COM_USERNAME</username>
      <password>***</password>
      <id>ossrh</id>
    </server>
  </servers>
  <pluginGroups xmlns="http://maven.apache.org/SETTINGS/1.1.0">
    <pluginGroup>org.apache.maven.plugins</pluginGroup>
    <pluginGroup>org.codehaus.mojo</pluginGroup>
  </pluginGroups>
</settings>

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.310 s
[INFO] Finished at: 2014-07-18T12:48:19-04:00
[INFO] Final Memory: 7M/17M
[INFO] ------------------------------------------------------------------------

我不明白它指的是哪个url。

清单第6项。使用最新版本的Maven,因为401:MNG-4469存在一个已知的问题

我使用的是最新版本:

[C:\]mvn -version
Apache Maven 3.2.2 (45f7c06d68e745d05611f7fd14efb6594181933e; 2014-06-17T09:51:42-04:00)
Maven home: C:\applications\programming\apache-maven-3.2.2
Java version: 1.7.0_51, vendor: Oracle Corporation
Java home: C:\applications\programming\jdk_7_51\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
   <servers>
     <server>
       <id>ossrh</id>
       <username>MY_SONATYPE_DOT_COM_USERNAME</username>
       <password>MY_SONATYPE_DOT_COM_PASSWORD</password>
     </server>
   </servers>

   <pluginGroups></pluginGroups>
   <proxies></proxies>
   <mirrors></mirrors>
   <profiles></profiles>
</settings>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <groupId>com.github.aliteralmind</groupId>
   <artifactId>xbnjava</artifactId>
   <packaging>pom</packaging>
   <version>0.1.2</version>
   <name>XBN-Java</name>
   <url>https://github.com/aliteralmind/xbnjava</url>
   <inceptionYear>2014</inceptionYear>
   <organization>
      <name>Jeff Epstein</name>
   </organization>
   <description>XBN-Java is a collection of generically-useful backend (server side, non-GUI) programming utilities, featuring RegexReplacer and FilteredLineIterator. XBN-Java is the foundation of Codelet (http://codelet.aliteralmind.com).</description>

   <parent>
      <groupId>org.sonatype.oss</groupId>
      <artifactId>oss-parent</artifactId>
      <version>7</version>
   </parent>

   <licenses>
      <license>
         <name>Lesser General Public License (LGPL) version 3.0</name>
         <url>https://www.gnu.org/licenses/lgpl-3.0.txt</url>
      </license>
      <license>
         <name>Apache Software License (ASL) version 2.0</name>
         <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      </license>
   </licenses>

   <developers>
      <developer>
         <name>Jeff Epstein</name>
         <email>aliteralmind-github@yahoo.com</email>
         <roles>
            <role>Lead Developer</role>
         </roles>
      </developer>
   </developers>

   <issueManagement>
      <system>GitHub Issue Tracker</system>
      <url>https://github.com/aliteralmind/xbnjava/issues</url>
   </issueManagement>

   <distributionManagement>
      <snapshotRepository>
         <id>ossrh</id>
         <url>https://oss.sonatype.org/content/repositories/snapshots</url>
      </snapshotRepository>
   </distributionManagement>

   <scm>
      <connection>scm:git:git@github.com:aliteralmind/xbnjava.git</connection>
      <url>scm:git:git@github.com:aliteralmind/xbnjava.git</url>
      <developerConnection>scm:git:git@github.com:aliteralmind/xbnjava.git</developerConnection>
   </scm>

   <properties>
      <java.version>1.7</java.version>
      <jarprefix>R:\jeffy\programming\build\/${project.artifactId}-${project.version}/download/${project.artifactId}-${project.version}</jarprefix>
   </properties>
<!--
  <profiles>
    <profile>
      <id>default-tools.jar</id>
      <activation>
        <property>
          <name>java.vendor</name>
          <value>Sun Microsystems Inc.</value>
        </property>
      </activation>
      <dependencies>
        <dependency>
          <groupId>com.sun</groupId>
          <artifactId>tools</artifactId>
          <version>1.4.2</version>
          <scope>system</scope>
          <systemPath>${java.home}/../lib/tools.jar</systemPath>
        </dependency>
      </dependencies>
    </profile>
  </profiles>
 -->
   <build>
      <plugins>
         <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <version>1.8</version>
            <executions>
               <execution>
                  <id>attach-artifacts</id>
                  <phase>package</phase>
                  <goals>
                     <goal>attach-artifact</goal>
                  </goals>
                  <configuration>
                     <artifacts>
                        <artifact>
                           <file>${jarprefix}-all.jar</file>
                           <type>jar</type>
                        </artifact>
                     </artifacts>
                  </configuration>
               </execution>
            </executions>
         </plugin>
      </plugins>
   </build>

   <profiles>
      <!--
      This profile will sign the JAR file, sources file, and javadocs file using the GPG key on the local machine.
      See: https://docs.sonatype.org/display/Repository/How+To+Generate+PGP+Signatures+With+Maven
      -->
      <profile>
         <id>release-sign-artifacts</id>
         <activation>
            <property>
               <name>release</name>
               <value>true</value>
            </property>
         </activation>
      </profile>
   </profiles>
</project>
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building XBN-Java 0.1.2
[INFO] ------------------------------------------------------------------------
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ xbnjava ---
[INFO] --- build-helper-maven-plugin:1.8:attach-artifact (attach-artifacts) @ xbnjava ---
[INFO] --- maven-install-plugin:2.4:install (default-install) @ xbnjava ---
[INFO] Installing R:\jeffy\programming\sandbox\z__for_git_commit_only\xbnjava\pom.xml to C:\Users\jeffy\.m2\repository\com\github\aliteralmind\xbnjava\0.1.2\xbnjava-0.1.2.pom
[INFO] Installing R:\jeffy\programming\build\xbnjava-0.1.2\download\xbnjava-0.1.2-all.jar to C:\Users\jeffy\.m2\repository\com\github\aliteralmind\xbnjava\0.1.2\xbnjava-0.1.2.jar
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ xbnjava ---
Uploading: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.2/xbnjava-0.1.2.pom
2/6 KB
4/6 KB
6/6 KB
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.204 s
[INFO] Finished at: 2014-07-18T11:25:17-04:00
[INFO] Final Memory: 7M/17M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project xbnjava: Failed to deploy artifacts: Could not transfer artifact com.github.aliteralmind:xbnjava:pom:0.1.2 from/to sonatype-nexus-staging (https://oss.sonatype.org/service/local/staging/deploy/maven2/): Failed to transfer file: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.2/xbnjava-0.1.2.pom. Return code is: 401, ReasonPhrase: Unauthorized. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building XBN-Java 0.1.2
[INFO] ------------------------------------------------------------------------
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ xbnjava ---
[INFO] --- build-helper-maven-plugin:1.8:attach-artifact (attach-artifacts) @ xbnjava ---
[INFO] --- maven-install-plugin:2.4:install (default-install) @ xbnjava ---
[INFO] Installing R:\jeffy\programming\sandbox\z__for_git_commit_only\xbnjava\pom.xml to C:\Users\jeffy\.m2\repository\com\github\aliteralmind\xbnjava\0.1.2\xbnjava-0.1.2.pom
[INFO] Installing R:\jeffy\programming\build\xbnjava-0.1.2\download\xbnjava-0.1.2-all.jar to C:\Users\jeffy\.m2\repository\com\github\aliteralmind\xbnjava\0.1.2\xbnjava-0.1.2.jar
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ xbnjava ---
Uploading: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.2/xbnjava-0.1.2.pom
2/6 KB
4/6 KB
6/6 KB

(故障部分:)

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.492 s
[INFO] Finished at: 2014-07-18T11:25:37-04:00
[INFO] Final Memory: 7M/17M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project xbnjava: Failed to deploy artifacts: Could not transfer artifact com.github.aliteralmind:xbnjava:pom:0.1.2 from/to sonatype-nexus-staging (https://oss.sonatype.org/service/local/staging/deploy/maven2/): Failed to transfer file: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.2/xbnjava-0.1.2.pom. Return code is: 401, ReasonPhrase: Unauthorized. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project xbnjava: Failed to deploy artifacts: Could not transfer artifact com.github.aliteralmind:xbnjava:pom:0.1.2 from/to sonatype-nexus-staging (https://oss.sonatype.org/service/local/staging/deploy/maven2/): Failed to transfer file: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.2/xbnjava-0.1.2.pom. Return code is: 401, ReasonPhrase: Unauthorized.
   at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
   at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
   at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
   at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
   at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
   at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
   at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
   at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
   at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
   at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
   at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
   at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:606)
   at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
   at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
   at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
   at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to deploy artifacts: Could not transfer artifact com.github.aliteralmind:xbnjava:pom:0.1.2 from/to sonatype-nexus-staging (https://oss.sonatype.org/service/local/staging/deploy/maven2/): Failed to transfer file: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.2/xbnjava-0.1.2.pom. Return code is: 401, ReasonPhrase: Unauthorized.
   at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:193)
   at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
   at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
   ... 19 more
Caused by: org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to deploy artifacts: Could not transfer artifact com.github.aliteralmind:xbnjava:pom:0.1.2 from/to sonatype-nexus-staging (https://oss.sonatype.org/service/local/staging/deploy/maven2/): Failed to transfer file: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.2/xbnjava-0.1.2.pom. Return code is: 401, ReasonPhrase: Unauthorized.
   at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:143)
   at org.apache.maven.plugin.deploy.AbstractDeployMojo.deploy(AbstractDeployMojo.java:167)
   at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:149)
   ... 21 more
Caused by: org.eclipse.aether.deployment.DeploymentException: Failed to deploy artifacts: Could not transfer artifact com.github.aliteralmind:xbnjava:pom:0.1.2 from/to sonatype-nexus-staging (https://oss.sonatype.org/service/local/staging/deploy/maven2/): Failed to transfer file: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.2/xbnjava-0.1.2.pom. Return code is: 401, ReasonPhrase: Unauthorized.
   at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:337)
   at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:268)
   at org.eclipse.aether.internal.impl.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:413)
   at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:139)
   ... 23 more
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact com.github.aliteralmind:xbnjava:pom:0.1.2 from/to sonatype-nexus-staging (https://oss.sonatype.org/service/local/staging/deploy/maven2/): Failed to transfer file: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.2/xbnjava-0.1.2.pom. Return code is: 401, ReasonPhrase: Unauthorized.
   at org.eclipse.aether.connector.wagon.WagonRepositoryConnector$6.wrap(WagonRepositoryConnector.java:1016)
   at org.eclipse.aether.connector.wagon.WagonRepositoryConnector$6.wrap(WagonRepositoryConnector.java:1004)
   at org.eclipse.aether.connector.wagon.WagonRepositoryConnector$PutTask.run(WagonRepositoryConnector.java:895)
   at org.eclipse.aether.connector.wagon.WagonRepositoryConnector.put(WagonRepositoryConnector.java:522)
   at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:331)
   ... 26 more
Caused by: org.apache.maven.wagon.TransferFailedException: Failed to transfer file: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.2/xbnjava-0.1.2.pom. Return code is: 401, ReasonPhrase: Unauthorized.
   at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:573)
   at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:493)
   at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:474)
   at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:454)
   at org.eclipse.aether.connector.wagon.WagonRepositoryConnector$PutTask.run(WagonRepositoryConnector.java:871)
   ... 28 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

共有1个答案

米裕
2023-03-14

在尝试将Gradle artefact部署到Nexus Sonatype存储库时,我也遇到过类似的错误。如果您提供了错误的凭据(密码等),您将得到一个401未经授权的错误。如果您试图将某个版本发布到版本库中,并且该版本已经存在于该版本库中,那么您还会得到一个错误(我的头上也有一个401错误)。因此,您可能会发现,通过命令行发布,它可以工作,但当您从脚本执行时,它会失败(因为它第一次在存储库中不存在)。或者使用不同的版本号发布,或者删除服务器上的旧人工制品并重新发布。

快照存储库(与发布存储库相反)允许您覆盖编号类似的版本,但您的版本号末尾应该有“-snapshot”。

 类似资料:
  • 我的代码:GoogleCredential凭据 credential.refreshToken() 错误日志: 创建服务号的步骤: 我在凭据中的oauth 2.0中创建了一个Web应用程序 然后我用客户端ID创建了一个服务号 现在我正在使用这个服务号和从它生成的p12证书来验证和创建Google凭据的对象 一旦刷新令牌,我就给了我401例外。 在这种情况下,任何帮助都会受到感激

  • 我试图测试Firebase Cloud messaging APIs,因为控制台没有提供所有功能(特别是当应用程序在后台时定制通知)。但由于某些原因,我无法让它工作,它总是显示401错误。我调查了出现这种情况的原因,并在重新生成新的服务器密钥后进行了尝试,但错误仍然存在。令人惊讶的是,当我生成一个新的服务器密钥时,它没有反映在Firebase控制台中,它将服务器密钥显示为空。此外,我尝试添加我的I

  • 我正在使用Maven Jib插件将我的应用程序部署到Gitlab docker注册表。如果我使用并输入用户名和密码,我可以成功登录gitlab注册表。我可以看到

  • 我是Spring boot和Spring Security的新手,出现以下错误: “错误401未经授权(c.e.l.security.jwt.AuthEntryPointJwt:未经授权的错误:访问此资源需要完全身份验证)” 我试过这个认证 我的问题是,当我成功登录时,我想请求获取用户列表。我发送的请求是一个安全GET请求,它是http://localhost:8084/loginsystem/a

  • 为什么当我试图从这里的主机获取信息时,我会收到401错误? 我在用我的代币,那不是应该给我完全的权限吗?

  • 问题内容: 我从Nexus存储库中检出了代码。我更改了帐户密码,并在文件中正确设置了密码。在执行时,我收到错误消息,说明它尝试从该存储库下载文件。 任何想法如何解决此错误?我在Maven 3.04中使用Windows 7 问题答案: 这里的问题是所使用的密码出现错字错误,由于密码中使用了字符/字母,因此很难识别。