我无法在 Linkedin 开发人员页面中更改 OAuth 范围。这就是为什么在尝试获取授权代码时我收到此错误的原因:
error=unauthorized_scope_error&error_description=Scope+%26quot%3Br_basicprofile%26quot%3B+is+not+authorized+for+your+application
Run Code Online (Sandbox Code Playgroud)
您可以在我的个人资料中看到 OAuth 范围部分。我只是无法设置任何范围。
我有一个Rental具有以下userId字段的实体:
@Column(name = "user_id", updatable = false, nullable = false)
private UUID userId;
Run Code Online (Sandbox Code Playgroud)
我也有一个JpaRepository:
public interface RentalRepository extends JpaRepository<Rental, UUID> {
@Query("FROM Rental r WHERE (:userId IS NULL OR r.userId = :userId) AND (:status IS NULL OR r.status = :status)")
Page<Rental> findAllUsingFilterUserIdAndStatus(@Param("userId") UUID userId,
@Param("status") RentalStatus status,
Pageable pageable);
}
Run Code Online (Sandbox Code Playgroud)
当我将userId作为 null 传递时,出现以下错误:
org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet
at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:280)
at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:254) …Run Code Online (Sandbox Code Playgroud) 这是我的日志配置。
<springProfile name="prod">
<root level="info">
<appender name="naki" class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>${logging_level}</level> <!-- setup via ENV variable log level -->
</filter>
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="ch.qos.logback.contrib.json.classic.JsonLayout">
<timestampFormat>yyyy-MM-dd'T'HH:mm:ss.SSSX</timestampFormat>
<timestampFormatTimezoneId>Etc/UTC</timestampFormatTimezoneId>
<appendLineSeparator>true</appendLineSeparator> <!-- don't forget line break -->
<jsonFormatter class="ch.qos.logback.contrib.jackson.JacksonJsonFormatter">
<prettyPrint>false
</prettyPrint> <!-- in prod never pretty print, line breaks are considered as separate log entry -->
</jsonFormatter>
</layout>
</encoder>
</appender>
</root>
</springProfile>
<springProfile name="dev">
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<root level="info">
<appender-ref ref="CONSOLE"/>
</root>
</springProfile>
Run Code Online (Sandbox Code Playgroud)
这是我得到的输出:
{"timestamp":"2020-01-13T13:38:38.001Z","level":"INFO","thread":"main","logger":"com.nakipower.identity.api.config.Application","message":"Started Application in 8.605 seconds (JVM running for 9.439)","context":"default"}
Run Code Online (Sandbox Code Playgroud)
如何将 JSON …